Trait http_request_validator::Validator
source · pub trait Validator<Data: Buf> {
type Error;
// Required method
fn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
parts: &'life1 Parts,
buffered_body: &'life2 Data
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}Expand description
The http::Request validator.
Runs over the buffered request body, so can be used to implement the request signature validation, or anything that needs a whole request available to conduct the validation.
You can provide your validation logic in this trait implementation. See the neighbouring crates for integrations with various web servers.
Required Associated Types§
Required Methods§
sourcefn validate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
parts: &'life1 Parts,
buffered_body: &'life2 Data
) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn validate<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, parts: &'life1 Parts, buffered_body: &'life2 Data ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Validate the request header and buffered body.