Trait carapax::access::AccessPolicy
source · pub trait AccessPolicy: Send {
type Error: Error + Send;
type Future: Future<Output = Result<bool, Self::Error>> + Send;
// Required method
fn is_granted(&self, input: HandlerInput) -> Self::Future;
}
Available on crate feature
access
only.Expand description
Decides whether HandlerInput
should be processed or not.
Required Associated Types§
sourcetype Error: Error + Send
type Error: Error + Send
An error that may be returned by the Self::is_granted
method.
Required Methods§
sourcefn is_granted(&self, input: HandlerInput) -> Self::Future
fn is_granted(&self, input: HandlerInput) -> Self::Future
Determines if access is granted for the given input.
§Arguments
input
- The input to be processed by the access policy.
The Self::Future
resolves to true
if access is allowed, and false
otherwise.