Trait saphir::guard::Guard

source ·
pub trait Guard {
    type Future: Future<Output = Result<Request<Body>, Self::Responder>> + Send;
    type Responder: Responder + Send;

    // Required method
    fn validate(&'static self, req: Request<Body>) -> Self::Future;
}
Expand description

Auto trait implementation over every function that match the definition of a guard.

Required Associated Types§

Required Methods§

source

fn validate(&'static self, req: Request<Body>) -> Self::Future

Implementors§

source§

impl<Fun, Fut, Resp> Guard for Funwhere Resp: Responder + Send, Fun: Fn(Request<Body>) -> Fut, Fut: 'static + Future<Output = Result<Request<Body>, Resp>> + Send,

§

type Future = Pin<Box<dyn Future<Output = Result<Request<Body<Bytes>>, <Fun as Guard>::Responder>> + Send + 'static, Global>>

§

type Responder = Resp