Struct BoxBody

Source
pub struct BoxBody { /* private fields */ }
Expand description

Dynamic Send body object.

Implementations§

Source§

impl BoxBody

Source

pub fn new( inner: Box<dyn Body<Data = <Bytes as IntoBuf>::Buf, Error = Status> + Send>, ) -> Self

Create a new BoxBody backed by inner.

Source

pub fn map_from<B>(inner: B) -> Self
where B: Body + Send + 'static, B::Data: Into<Bytes>,

Create a new BoxBody mapping item and error to the default types.

Trait Implementations§

Source§

impl Body for BoxBody

Source§

type Data = <Bytes as IntoBuf>::Buf

Values yielded by the Body.
Source§

type Error = Status

The error type this BufStream might generate.
Source§

fn is_end_stream(&self) -> bool

Returns true when the end of stream has been reached. Read more
Source§

fn poll_data(&mut self) -> Poll<Option<Self::Data>, Self::Error>

Attempt to pull out the next data buffer of this stream.
Source§

fn poll_trailers(&mut self) -> Poll<Option<HeaderMap>, Self::Error>

Poll for an optional single HeaderMap of trailers. Read more
Source§

fn size_hint(&self) -> SizeHint

Returns the bounds on the remaining length of the stream. Read more
Source§

impl Debug for BoxBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Body for T
where T: Body, <T as Body>::Error: Into<Box<dyn Error + Send + Sync>>,

Source§

type Data = <T as Body>::Data

Source§

type Error = <T as Body>::Error

Source§

fn is_end_stream(&self) -> bool

Source§

fn poll_data( &mut self, ) -> Result<Async<Option<<T as Body>::Data>>, <T as Body>::Error>

Source§

fn poll_trailers( &mut self, ) -> Result<Async<Option<HeaderMap>>, <T as Body>::Error>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, U> Encodable<BoxBody> for T
where T: Stream<Item = U, Error = Status> + Send + 'static, U: Message + 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.