pub struct Body { /* private fields */ }
Expand description
An asynchronous request body.
Returns a reference to the internal data of the Body
.
None
is returned, if the underlying data is a stream.
Available on crate feature stream
only.
Wrap a futures Stream
in a box inside Body
.
let chunks: Vec<Result<_, ::std::io::Error>> = vec![
Ok("hello"),
Ok(" "),
Ok("world"),
];
let stream = futures_util::stream::iter(chunks);
let body = Body::wrap_stream(stream);
This requires the stream
feature to be enabled.
Formats the value using the given formatter.
Read moresourceimpl From<&'static [u8]> for Body
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
sourceAvailable on crate feature stream
only.
Converts to this type from the input type.
A Response
can be piped as the Body
of another request.
Converts to this type from the input type.
Converts to this type from the input type.
Converts to this type from the input type.
sourceimpl<T> Any for Twhere
T: 'static + ?Sized,
sourceimpl<T> Borrow<T> for Twhere
T: ?Sized,
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read moresourceimpl<T> From<T> for T
Returns the argument unchanged.
Instruments this type with the provided
Span
, returning an
Instrumented
wrapper.
Read more
sourceimpl<T, U> Into<U> for Twhere
U: From<T>,
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
sourceimpl<T, U> TryFrom<U> for Twhere
U: Into<T>,
The type returned in the event of a conversion error.
Performs the conversion.
sourceimpl<T, U> TryInto<U> for Twhere
U: TryFrom<T>,
The type returned in the event of a conversion error.
Performs the conversion.
impl<V, T> VZip<V> for Twhere
V: MultiLane<T>,