pub struct StreamingResponseBody<'scope> { /* private fields */ }Expand description
Pull input backed by the connection’s HTTP reader, with no response frame queue. The boxed stream retains the decoder’s borrowed state across reads. Dropping a pending read retains that state; cancelling an active read retires the exchange. Return/drop active handles before joining cancelled cleanup.
Trait Implementations§
Source§impl ReadableBody for StreamingResponseBody<'_>
impl ReadableBody for StreamingResponseBody<'_>
type Error = Error
Source§fn length(&self) -> Option<u64>
fn length(&self) -> Option<u64>
Total representation length, independent of the current read position.
Source§fn may_have_trailers(&self) -> bool
fn may_have_trailers(&self) -> bool
Whether this body can emit trailing headers. HTTP/1 needs this before
reading to choose chunked framing, even when the data length is known.
Returning false promises that no Headers frame will be produced.
Source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Whether no unread payload frames remain. False can mean unknown; an open
queue with no frames is not exhausted. This does not suppress read errors.
Source§fn close(&mut self, _: Option<Error>)
fn close(&mut self, _: Option<Error>)
Abandon further application reads, optionally reporting their failure. Read more
Source§async fn read(
&mut self,
cancellation: &Cancellation,
) -> Result<BodyFrame<Vec<u8>>, Error>
async fn read( &mut self, cancellation: &Cancellation, ) -> Result<BodyFrame<Vec<u8>>, Error>
Read one owned frame. Pre-cancellation prevents consumption. The caller
stops after
frame.is_end(); subsequent reads return BodyFrame::End.
Headers occur at most once, after all data. Dropping a pending read is
not transport retirement, and must not lose an unreturned queued frame.Source§fn is_ready(&self) -> bool
fn is_ready(&self) -> bool
Whether another read can proceed without waiting for produced data. Read more
fn is_rewindable(&self) -> bool
Auto Trait Implementations§
impl<'scope> !RefUnwindSafe for StreamingResponseBody<'scope>
impl<'scope> !Sync for StreamingResponseBody<'scope>
impl<'scope> !UnwindSafe for StreamingResponseBody<'scope>
impl<'scope> Freeze for StreamingResponseBody<'scope>
impl<'scope> Send for StreamingResponseBody<'scope>
impl<'scope> Unpin for StreamingResponseBody<'scope>
impl<'scope> UnsafeUnpin for StreamingResponseBody<'scope>
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