Struct hyper::body::Body [−][src]
pub struct Body { /* fields omitted */ }
Expand description
A stream of Bytes
, used when receiving bodies.
A good default HttpBody
to use in many
applications.
Note: To read the full body, use body::to_bytes
or body::aggregate
.
Implementations
Create an empty Body
stream.
Example
use hyper::{Body, Request};
// create a `GET /` request
let get = Request::new(Body::empty());
Trait Implementations
Attempt to pull out the next data buffer of this stream.
Poll for an optional single HeaderMap
of trailers. Read more
Returns true
when the end of stream has been reached. Read more
Returns the bounds on the remaining length of the stream. Read more
Returns future that resolves to next data chunk, if any.
Returns future that resolves to trailers, if any.
Maps this body’s data value to a different value.
Maps this body’s error value to a different value.
Turn this body into a boxed trait object.
Turn this body into a boxed trait object that is !Sync.
Auto Trait Implementations
impl !RefUnwindSafe for Body
impl !UnwindSafe for Body
Blanket Implementations
Mutably borrows from an owned value. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more