pub trait ValidateRequest<B> {
    type ResponseBody;

    // Required method
    fn validate(
        &mut self,
        request: &mut Request<B>
    ) -> Result<(), Response<Self::ResponseBody>>;
}
Available on crate feature validate-request only.
Expand description

Trait for validating requests.

Required Associated Types§

source

type ResponseBody

The body type used for responses to unvalidated requests.

Required Methods§

source

fn validate( &mut self, request: &mut Request<B> ) -> Result<(), Response<Self::ResponseBody>>

Validate the request.

If Ok(()) is returned then the request is allowed through, otherwise not.

Implementors§

source§

impl<B, F, ResBody> ValidateRequest<B> for F
where F: FnMut(&mut Request<B>) -> Result<(), Response<ResBody>>,

§

type ResponseBody = ResBody

source§

impl<B, ResBody> ValidateRequest<B> for Basic<ResBody>
where ResBody: Body + Default,

Available on crate feature auth only.
§

type ResponseBody = ResBody

source§

impl<B, ResBody> ValidateRequest<B> for Bearer<ResBody>
where ResBody: Body + Default,

Available on crate feature auth only.
§

type ResponseBody = ResBody

source§

impl<B, ResBody> ValidateRequest<B> for AcceptHeader<ResBody>
where ResBody: Body + Default,

§

type ResponseBody = ResBody