[][src]Struct hyper::Body

#[must_use = "streams do nothing unless polled"]
pub struct Body { /* fields omitted */ }

A Stream for Chunks used in requests and responses.

Methods

impl Body[src]

pub fn empty() -> Body[src]

Return an empty body stream

pub fn pair() -> (Sender<Result<Chunk, Error>>, Body)[src]

Return a body stream with an associated sender half

pub fn is_empty(&self) -> bool[src]

Returns if this body was constructed via Body::empty().

Note

This does not detect if the body stream may be at the end, or if the stream will not yield any chunks, in all cases. For instance, a streaming body using chunked encoding is not able to tell if there are more chunks immediately.

Trait Implementations

impl Debug for Body[src]

impl Default for Body[src]

impl From<&'static [u8]> for Body[src]

impl From<&'static str> for Body[src]

impl From<Bytes> for Body[src]

impl From<Chunk> for Body[src]

impl From<Cow<'static, [u8]>> for Body[src]

impl From<Cow<'static, str>> for Body[src]

impl From<Option<Body>> for Body[src]

impl From<Receiver<Result<Chunk, Error>>> for Body[src]

impl From<String> for Body[src]

impl From<Vec<u8>> for Body[src]

impl Stream for Body[src]

type Item = Chunk

The type of item this stream will yield on success.

type Error = Error

The type of error this stream may generate.

Auto Trait Implementations

impl !RefUnwindSafe for Body

impl Send for Body

impl Sync for Body

impl Unpin for Body

impl !UnwindSafe for Body

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> StreamExt for T where
    T: Stream + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.