pub struct EmptyBody;Expand description
A ready body with no data and a representation length of zero.
Trait Implementations§
impl Copy for EmptyBody
Source§impl ReadableBody for EmptyBody
impl ReadableBody for EmptyBody
type Error = Cancelled
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_ready(&self) -> bool
fn is_ready(&self) -> bool
Whether another read can proceed without waiting for produced data. Read more
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 length(&self) -> Option<u64>
fn length(&self) -> Option<u64>
Total representation length, independent of the current read position.
Source§fn close(&mut self, _error: Option<Self::Error>)
fn close(&mut self, _error: Option<Self::Error>)
Abandon further application reads, optionally reporting their failure. Read more
Source§async fn read(
&mut self,
cancellation: &Cancellation,
) -> Result<BodyFrame<Self::Data>, Self::Error>
async fn read( &mut self, cancellation: &Cancellation, ) -> Result<BodyFrame<Self::Data>, Self::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.fn is_rewindable(&self) -> bool
Auto Trait Implementations§
impl Freeze for EmptyBody
impl RefUnwindSafe for EmptyBody
impl Send for EmptyBody
impl Sync for EmptyBody
impl Unpin for EmptyBody
impl UnsafeUnpin for EmptyBody
impl UnwindSafe for EmptyBody
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