#[non_exhaustive]pub enum OutgoingBody {
Empty,
Full(u64),
Length(u64),
Chunked,
}Expand description
How the body of a response written with
ServerConn::write_head is supplied.
§Examples
use http_net::OutgoingBody;
let body = b"hello";
let full = OutgoingBody::Full(body.len() as u64);
assert_ne!(full, OutgoingBody::Chunked);Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Empty
No body: content-length: 0 (or nothing, for a status that never
carries one).
Full(u64)
A body of exactly this many bytes that the caller writes itself,
right after the head (for example with one vectored write of head and
body); sent with content-length. The response is complete once the
caller has written them.
Length(u64)
A streamed body of exactly this many bytes, sent with
content-length through send_body and end_body.
Chunked
A streamed body with chunked encoding (close-delimited to an
HTTP/1.0 client), through send_body and end_body.
Trait Implementations§
Source§impl Clone for OutgoingBody
impl Clone for OutgoingBody
impl Copy for OutgoingBody
Source§impl Debug for OutgoingBody
impl Debug for OutgoingBody
impl Eq for OutgoingBody
Source§impl Hash for OutgoingBody
impl Hash for OutgoingBody
Source§impl PartialEq for OutgoingBody
impl PartialEq for OutgoingBody
impl StructuralPartialEq for OutgoingBody
Auto Trait Implementations§
impl Freeze for OutgoingBody
impl RefUnwindSafe for OutgoingBody
impl Send for OutgoingBody
impl Sync for OutgoingBody
impl Unpin for OutgoingBody
impl UnsafeUnpin for OutgoingBody
impl UnwindSafe for OutgoingBody
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