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§

source

type Error: Error + Send

An error that may be returned by the Self::is_granted method.

source

type Future: Future<Output = Result<bool, Self::Error>> + Send

A future representing the result of the Self::is_granted method.

Required Methods§

source

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.

Implementors§