pub struct HeadBody { /* private fields */ }Expand description
An empty body retaining the representation length for a HEAD response.
Implementations§
Trait Implementations§
impl Copy for HeadBody
Source§impl ReadableBody for HeadBody
impl ReadableBody for HeadBody
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 HeadBody
impl RefUnwindSafe for HeadBody
impl Send for HeadBody
impl Sync for HeadBody
impl Unpin for HeadBody
impl UnsafeUnpin for HeadBody
impl UnwindSafe for HeadBody
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