pub struct BufferingValidator<Bufferer, InBody, BufferedToOutBody = TrivialBufferedToOutBodyFor<Bufferer, InBody>> {
pub bufferer: Bufferer,
pub phantom_data: PhantomData<(fn() -> InBody, BufferedToOutBody)>,
}Expand description
The buffering validator.
Fields§
§bufferer: BuffererThe bufferer.
phantom_data: PhantomData<(fn() -> InBody, BufferedToOutBody)>The phantom data types.
Implementations§
Source§impl<Bufferer, InBody> BufferingValidator<Bufferer, InBody, TrivialBufferedToOutBodyFor<Bufferer, InBody>>
impl<Bufferer, InBody> BufferingValidator<Bufferer, InBody, TrivialBufferedToOutBodyFor<Bufferer, InBody>>
Sourcepub const fn new(bufferer: Bufferer) -> Self
pub const fn new(bufferer: Bufferer) -> Self
Create a new BufferingValidator with trivial BufferedToOutBody.
Source§impl<Bufferer, InBody, BufferedToOutBody> BufferingValidator<Bufferer, InBody, BufferedToOutBody>
impl<Bufferer, InBody, BufferedToOutBody> BufferingValidator<Bufferer, InBody, BufferedToOutBody>
Sourcepub fn with_buffered_to_out_body<New>(
self,
) -> BufferingValidator<Bufferer, InBody, New>
pub fn with_buffered_to_out_body<New>( self, ) -> BufferingValidator<Bufferer, InBody, New>
Change the BufferedToOutBody type.
Source§impl<Bufferer, InBody, BufferedToOutBody> BufferingValidator<Bufferer, InBody, BufferedToOutBody>where
InBody: Body,
Bufferer: Bufferer<InBody>,
BufferedToOutBody: BufferedToBody<Buffered = BufferedFor<Bufferer, InBody>>,
impl<Bufferer, InBody, BufferedToOutBody> BufferingValidator<Bufferer, InBody, BufferedToOutBody>where
InBody: Body,
Bufferer: Bufferer<InBody>,
BufferedToOutBody: BufferedToBody<Buffered = BufferedFor<Bufferer, InBody>>,
Sourcepub async fn validate<Validator>(
&self,
validator: Validator,
req: Request<InBody>,
) -> Result<Request<BufferedToOutBody::Body>, Error<Bufferer::Error, Validator::Error>>
pub async fn validate<Validator>( &self, validator: Validator, req: Request<InBody>, ) -> Result<Request<BufferedToOutBody::Body>, Error<Bufferer::Error, Validator::Error>>
Validate the given request.
Takes the InBody out of the request, buffers it, validates the buffered body data using
the specified validator, and then converts the buffered stuff with BufferedToOutBody to
get the BufferedToOutBody::Body type.
Auto Trait Implementations§
impl<Bufferer, InBody, BufferedToOutBody> Freeze for BufferingValidator<Bufferer, InBody, BufferedToOutBody>where
Bufferer: Freeze,
impl<Bufferer, InBody, BufferedToOutBody> RefUnwindSafe for BufferingValidator<Bufferer, InBody, BufferedToOutBody>where
Bufferer: RefUnwindSafe,
BufferedToOutBody: RefUnwindSafe,
impl<Bufferer, InBody, BufferedToOutBody> Send for BufferingValidator<Bufferer, InBody, BufferedToOutBody>
impl<Bufferer, InBody, BufferedToOutBody> Sync for BufferingValidator<Bufferer, InBody, BufferedToOutBody>
impl<Bufferer, InBody, BufferedToOutBody> Unpin for BufferingValidator<Bufferer, InBody, BufferedToOutBody>
impl<Bufferer, InBody, BufferedToOutBody> UnwindSafe for BufferingValidator<Bufferer, InBody, BufferedToOutBody>where
Bufferer: UnwindSafe,
BufferedToOutBody: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more