pub enum HttpBody {
Empty,
Bytes(Bytes),
Stream {
len: u64,
stream: BoxStream<'static, Result<Bytes, ServerError>>,
},
}Expand description
A response body. Stream carries its exact length: the stream errors
instead of yielding more or fewer bytes.
Variants§
Empty
No body (HEAD, 204, 304 and every error but the canned 404).
Bytes(Bytes)
The whole body in memory.
Stream
A body of exactly len bytes, streamed in pieces.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HttpBody
impl !RefUnwindSafe for HttpBody
impl !Sync for HttpBody
impl !UnwindSafe for HttpBody
impl Send for HttpBody
impl Unpin for HttpBody
impl UnsafeUnpin for HttpBody
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