Bufferer

Trait Bufferer 

Source
pub trait Bufferer<InBody: Body> {
    type Buffered: AsBuf;
    type Error;

    // Required method
    fn buffer(
        &self,
        body: InBody,
    ) -> impl Future<Output = Result<Self::Buffered, Self::Error>>;
}
Expand description

The ability to buffer and validate an http_body::Body.

Required Associated Types§

Source

type Buffered: AsBuf

The buffered body type.

Source

type Error

An error that can occur while buffering.

Required Methods§

Source

fn buffer( &self, body: InBody, ) -> impl Future<Output = Result<Self::Buffered, Self::Error>>

Buffer the given body into Self::Buffered.

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.

Implementors§

Source§

impl<InBody> Bufferer<InBody> for Bufferer<Bytes>
where InBody: Body,

Source§

impl<InBody> Bufferer<InBody> for Bufferer<BoxBuf>
where InBody: Body, <InBody as Body>::Data: 'static,

Source§

type Buffered = Buffered<Box<dyn Buf>>

Source§

type Error = <InBody as Body>::Error