[][src]Struct surf::middleware::Body

pub struct Body { /* fields omitted */ }

The raw body of an http request or response.

A body is a stream of Bytes values, which are shared handles to byte buffers. Both Body and Bytes values can be easily created from standard owned byte buffer types like Vec<u8> or String, using the From trait.

Methods

impl Body[src]

pub fn empty() -> Self[src]

Create a new empty body.

pub fn from_reader(reader: impl AsyncRead + Unpin + Send + 'static) -> Self[src]

Create a new instance from a reader.

Trait Implementations

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

impl<R: AsyncRead + Unpin + Send + 'static> From<Box<R>> for Body[src]

fn from(reader: Box<R>) -> Self[src]

Converts an AsyncRead into a Body.

impl Debug for Body[src]

impl AsyncRead for Body[src]

Auto Trait Implementations

impl Send for Body

impl !Sync for Body

impl Unpin for Body

impl !UnwindSafe for Body

impl !RefUnwindSafe for Body

Blanket Implementations

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

impl<T> From<T> for 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.

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

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

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

impl<R> AsyncReadExt for R where
    R: AsyncRead + ?Sized
[src]