pub struct StreamHttpBody<S> { /* private fields */ }
Expand description
A wrapper around BytesStream
implementing http_body::Body
.
Trait Implementations
sourceimpl<S: BytesStream> Body for StreamHttpBody<S>
impl<S: BytesStream> Body for StreamHttpBody<S>
sourcefn poll_data(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Data>>>
fn poll_data(
self: Pin<&mut Self>,
cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Data>>>
Attempt to pull out the next data buffer of this stream.
sourcefn poll_trailers(
self: Pin<&mut Self>,
_: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap>>>
fn poll_trailers(
self: Pin<&mut Self>,
_: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap>>>
Poll for an optional single HeaderMap
of trailers. Read more
sourcefn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Returns true
when the end of stream has been reached. Read more
sourcefn size_hint(&self) -> SizeHint
fn size_hint(&self) -> SizeHint
Returns the bounds on the remaining length of the stream. Read more
sourcefn data(&mut self) -> Data<'_, Self> where
Self: Unpin,
fn data(&mut self) -> Data<'_, Self> where
Self: Unpin,
Returns future that resolves to next data chunk, if any.
sourcefn trailers(&mut self) -> Trailers<'_, Self> where
Self: Unpin,
fn trailers(&mut self) -> Trailers<'_, Self> where
Self: Unpin,
Returns future that resolves to trailers, if any.
sourcefn map_data<F, B>(self, f: F) -> MapData<Self, F> where
F: FnMut(Self::Data) -> B,
B: Buf,
fn map_data<F, B>(self, f: F) -> MapData<Self, F> where
F: FnMut(Self::Data) -> B,
B: Buf,
Maps this body’s data value to a different value.
sourcefn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
F: FnMut(Self::Error) -> E,
fn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
F: FnMut(Self::Error) -> E,
Maps this body’s error value to a different value.
sourcefn boxed(self) -> BoxBody<Self::Data, Self::Error> where
Self: 'static + Send + Sync,
fn boxed(self) -> BoxBody<Self::Data, Self::Error> where
Self: 'static + Send + Sync,
Turn this body into a boxed trait object.
sourcefn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error> where
Self: 'static + Send,
fn boxed_unsync(self) -> UnsyncBoxBody<Self::Data, Self::Error> where
Self: 'static + Send,
Turn this body into a boxed trait object that is !Sync.
sourceimpl<S: Debug> Debug for StreamHttpBody<S>
impl<S: Debug> Debug for StreamHttpBody<S>
impl<'__pin, S> Unpin for StreamHttpBody<S> where
__Origin<'__pin, S>: Unpin,
Auto Trait Implementations
impl<S> RefUnwindSafe for StreamHttpBody<S> where
S: RefUnwindSafe,
impl<S> Send for StreamHttpBody<S> where
S: Send,
impl<S> Sync for StreamHttpBody<S> where
S: Sync,
impl<S> UnwindSafe for StreamHttpBody<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more