pub enum Message<T> {
Item(T),
Chunk(Option<Bytes>),
}Expand description
A message passed to an HTTP/1 request or response encoder.
Encoding a message starts with Message::Item. If the head declares a
body, zero or more Message::Chunk(Some(_)) values follow,
and Message::Chunk(None) completes the body. The final
None writes the chunked terminator when required and verifies that a
fixed-length body supplied all declared bytes.
A new Message::Item must not be encoded until the preceding body has
completed. Body chunks should be non-empty; use Message::Chunk(None) to
complete the body explicitly.
Variants§
Item(T)
A complete request or response head, including the body-size metadata required by the concrete codec.
Chunk(Option<Bytes>)
Body bytes, or None to complete the current body.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Message<T>where
T: Freeze,
impl<T> RefUnwindSafe for Message<T>where
T: RefUnwindSafe,
impl<T> Send for Message<T>where
T: Send,
impl<T> Sync for Message<T>where
T: Sync,
impl<T> Unpin for Message<T>where
T: Unpin,
impl<T> UnsafeUnpin for Message<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Message<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