pub trait Validator<Data: Buf> {
type Error;
// Required method
fn validate<'a>(
&'a self,
parts: &'a Parts,
buffered_body: &'a Data,
) -> impl Future<Output = Result<(), Self::Error>> + Send + 'a;
}
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§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.