Struct BodyDynBox

Source
pub struct BodyDynBox(/* private fields */);

Implementations§

Source§

impl BodyDynBox

Source

pub fn new(_body: impl BodyDyn + Sync) -> Self

Trait Implementations§

Source§

impl Body for BodyDynBox

Source§

type Data = Bytes

Values yielded by the Body.
Source§

type Error = Error

The error type this Body might generate.
Source§

fn poll_data( self: Pin<&mut Self>, _context: &mut Context<'_>, ) -> Poll<Option<ServerResult<Bytes>>>

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

fn poll_trailers( self: Pin<&mut Self>, _context: &mut Context<'_>, ) -> Poll<ServerResult<Option<Headers>>>

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

fn is_end_stream(&self) -> bool

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

fn size_hint(&self) -> BodySizeHint

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

fn data(&mut self) -> Data<'_, Self>
where Self: Sized + Unpin,

Returns future that resolves to next data chunk, if any.
Source§

fn trailers(&mut self) -> Trailers<'_, Self>
where Self: Sized + Unpin,

Returns future that resolves to trailers, if any.
Source§

fn map_data<F, B>(self, f: F) -> MapData<Self, F>
where Self: Sized, F: FnMut(Self::Data) -> B, B: Buf,

Maps this body’s data value to a different value.
Source§

fn map_err<F, E>(self, f: F) -> MapErr<Self, F>
where Self: Sized, F: FnMut(Self::Error) -> E,

Maps this body’s error value to a different value.
Source§

fn collect(self) -> Collect<Self>
where Self: Sized,

Turn this body into Collected body which will collect all the DATA frames and trailers.
Source§

fn boxed(self) -> BoxBody<Self::Data, Self::Error>
where Self: Sized + Send + Sync + 'static,

Turn this body into a boxed trait object.
Source§

fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error>
where Self: Sized + Send + 'static,

Turn this body into a boxed trait object that is !Sync.

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<B> BodyDyn for B
where B: Body<Data = Bytes> + Send + 'static, <B as Body>::Error: Error + Send + Sync + 'static,

Source§

fn poll_data( self: Pin<&mut B>, _context: &mut Context<'_>, ) -> Poll<Option<Result<Bytes, Error>>>

Source§

fn poll_trailers( self: Pin<&mut B>, _context: &mut Context<'_>, ) -> Poll<Result<Option<HeaderMap>, Error>>

Source§

fn is_end_stream(&self) -> bool

Source§

fn size_hint(&self) -> SizeHint

Source§

impl<B> BodyExt for B
where B: Body<Data = Bytes> + Send + Sync + 'static + Unpin, <B as Body>::Error: Error + Send + Sync + 'static,

Source§

fn consume_into_vec( &mut self, _buffer: &mut Vec<u8>, _runtime: Option<&Runtime>, ) -> Result<(), Error>

Source§

fn consume_to_vec( &mut self, _runtime: Option<&Runtime>, ) -> ServerResult<Vec<u8>>

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<EI, EO> ErrorExtWrap<EO> for EI
where EO: ErrorExtWrapFrom<EI>,

Source§

fn wrap(self, _code: u32) -> EO

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more