[][src]Struct hyper::body::Body

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

A stream of Bytes, used when receiving bodies.

A good default HttpBody to use in many applications.

Implementations

impl Body[src]

pub fn empty() -> Body[src]

Create an empty Body stream.

Example

use hyper::{Body, Request};

// create a `GET /` request
let get = Request::new(Body::empty());

pub fn channel() -> (Sender, Body)[src]

Create a Body stream with an associated sender half.

Useful when wanting to stream chunks from another thread.

Trait Implementations

impl Body for Body[src]

type Data = Bytes

Values yielded by the Body.

type Error = Error

The error type this Body might generate.

impl Debug for Body[src]

impl Default for Body[src]

fn default() -> Body[src]

Returns Body::empty().

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

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

impl From<Bytes> for Body[src]

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

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

impl From<String> for Body[src]

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

Auto Trait Implementations

impl !RefUnwindSafe for Body[src]

impl Send for Body[src]

impl Sync for Body[src]

impl Unpin for Body[src]

impl !UnwindSafe for Body[src]

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> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.