pub struct StreamDataBody<T> { /* private fields */ }Expand description
Bidirectional adapter between Stream and Body:
- When the inner value implements
Body, this type implementsStreamyieldingResult<Body::Data, Body::Error>. Trailer frames are ignored and treated as end of stream. - When the inner value implements
Stream, this type implementsBodywrapping each streamed item intoFrame::Data.
Implementations§
Source§impl<T> StreamDataBody<T>
impl<T> StreamDataBody<T>
Trait Implementations§
Source§impl<S, T, E> Body for StreamDataBody<S>
impl<S, T, E> Body for StreamDataBody<S>
Source§type Data = T
type Data = T
The payload data type yielded by
Frame::Data variants.Source§fn poll_frame(
self: Pin<&mut Self>,
cx: &mut Context<'_>,
) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>
fn poll_frame( self: Pin<&mut Self>, cx: &mut Context<'_>, ) -> Poll<Option<Result<Frame<Self::Data>, Self::Error>>>
Attempt to pull the next frame from the body. Read more
Source§fn is_end_stream(&self) -> bool
fn is_end_stream(&self) -> bool
Indicates whether the body has been fully consumed. Read more
Source§impl<T: Debug> Debug for StreamDataBody<T>
impl<T: Debug> Debug for StreamDataBody<T>
Source§impl<B> Stream for StreamDataBody<B>where
B: Body,
impl<B> Stream for StreamDataBody<B>where
B: Body,
impl<'__pin, T> Unpin for StreamDataBody<T>where
PinnedFieldsOf<__Origin<'__pin, T>>: Unpin,
Auto Trait Implementations§
impl<T> Freeze for StreamDataBody<T>where
T: Freeze,
impl<T> RefUnwindSafe for StreamDataBody<T>where
T: RefUnwindSafe,
impl<T> Send for StreamDataBody<T>where
T: Send,
impl<T> Sync for StreamDataBody<T>where
T: Sync,
impl<T> UnsafeUnpin for StreamDataBody<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for StreamDataBody<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more