pub enum Body {
Bytes(ByteBody),
Http1(Http1Body<Encryption>),
Http2(RecvStream),
Http3(RequestStream<RecvStream, Bytes>),
}
Expand description
A body of a Request
.
The inner variables are streams. To get the bytes, use Body::read_to_bytes()
when needed.
Also see FatRequest
.
Variants§
Bytes(ByteBody)
A body of Bytes
.
Can be used by HTTP/2 push to simulate a GET request, or any other extensions which wants a Kvarn response.
Http1(Http1Body<Encryption>)
A buffered HTTP/1 body.
While the HTTP/1 headers were read, it reads too much
and some of the body will be read.
Therefore, the already read bytes are stored.
Body::read_to_bytes
leverages this and just
continues writing to the buffer.
Http2(RecvStream)
Available on crate feature
http2
only.An HTTP/2 body provided by [h2
].
Http3(RequestStream<RecvStream, Bytes>)
Available on crate feature
http3
only.An HTTP/3 body provided by [h3
].
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Body
impl !RefUnwindSafe for Body
impl !Send for Body
impl !Sync for Body
impl Unpin for Body
impl !UnwindSafe for Body
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