Trait BytesBody

Source
pub trait BytesBody: Send {
    // Required method
    fn into_bytes<'life0, 'async_trait>(
        &'life0 mut self,
    ) -> Pin<Box<dyn Future<Output = Result<Bytes, Box<dyn StdError + Send + Sync + 'static>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Object safe body trait

Required Methods§

Source

fn into_bytes<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Bytes, Box<dyn StdError + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Convert the body into Bytes

This consumes the body. The behavior for calling this method multiple times is undefined.

Implementations on Foreign Types§

Source§

impl BytesBody for Bytes

Source§

fn into_bytes<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Bytes, Box<dyn StdError + Send + Sync + 'static>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Implementors§

Source§

impl<B> BytesBody for BodyWrapper<B>
where B: Body + Send + Unpin + 'static, B::Data: Send, B::Error: Into<Box<dyn StdError + Send + Sync + 'static>>,