http::body
On this page
Message bodies: a stream of byte chunks over a channel.
Structs
BodySource
pub struct BodyA message body: a stream of byte chunks read once with chunk,
bytes or text. A body built from bytes also keeps them, so a
request with one can be resent (redirects). A body has one owner:
let b = a, storing it or capturing it moves it.
Sourcepub fn channel(§cap: usize = 4, len: u64 | none = none) -> (BodyWriter, Body) A body fed by the returned writer, with room for
capchunks in flight.len: the total, if known in advance.The length, if known.
Whether the body is known to be empty.
The bytes it was built from, if it was.
The next chunk, or
noneat the end.The whole body; throws
TooLargepastlimitbytes.The whole body as UTF-8 text.
BodyWriterSource
pub struct BodyWriterThe feeding end of Body::channel.
Send a chunk; waits while
capchunks are unread. ThrowsClosedwhen the reader is gone.End the body.
End the body with an error the reader gets.