Struct http_body::Empty[][src]

pub struct Empty<D> { /* fields omitted */ }

A body that is always empty.

Implementations

impl<D> Empty<D>[src]

pub fn new() -> Self[src]

Create a new Empty.

Trait Implementations

impl<D: Buf> Body for Empty<D>[src]

type Data = D

Values yielded by the Body.

type Error = Infallible

The error type this Body might generate.

fn poll_data(
    self: Pin<&mut Self>,
    _cx: &mut Context<'_>
) -> Poll<Option<Result<Self::Data, Self::Error>>>
[src]

Attempt to pull out the next data buffer of this stream.

fn poll_trailers(
    self: Pin<&mut Self>,
    _cx: &mut Context<'_>
) -> Poll<Result<Option<HeaderMap>, Self::Error>>
[src]

Poll for an optional single HeaderMap of trailers. Read more

fn is_end_stream(&self) -> bool[src]

Returns true when the end of stream has been reached. Read more

fn size_hint(&self) -> SizeHint[src]

Returns the bounds on the remaining length of the stream. Read more

fn data(&mut self) -> Data<'_, Self>

Notable traits for Data<'a, T>

impl<'a, T: Body + Unpin + ?Sized> Future for Data<'a, T> type Output = Option<Result<T::Data, T::Error>>;
where
    Self: Unpin + Sized
[src]

Returns future that resolves to next data chunk, if any.

fn trailers(&mut self) -> Trailers<'_, Self>

Notable traits for Trailers<'a, T>

impl<'a, T: Body + Unpin + ?Sized> Future for Trailers<'a, T> type Output = Result<Option<HeaderMap>, T::Error>;
where
    Self: Unpin + Sized
[src]

Returns future that resolves to trailers, if any.

fn map_data<F, B>(self, f: F) -> MapData<Self, F> where
    Self: Sized,
    F: FnMut(Self::Data) -> B,
    B: Buf
[src]

Maps this body’s data value to a different value.

fn map_err<F, E>(self, f: F) -> MapErr<Self, F> where
    Self: Sized,
    F: FnMut(Self::Error) -> E, 
[src]

Maps this body’s error value to a different value.

fn boxed(self) -> BoxBody<Self::Data, Self::Error> where
    Self: Sized + Send + Sync + 'static, 
[src]

Turn this body into a boxed trait object.

impl<D> Clone for Empty<D>[src]

fn clone(&self) -> Self[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<D> Debug for Empty<D>[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl<D> Default for Empty<D>[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<D> Copy for Empty<D>[src]

Auto Trait Implementations

impl<D> RefUnwindSafe for Empty<D>

impl<D> Send for Empty<D>

impl<D> Sync for Empty<D>

impl<D> Unpin for Empty<D>

impl<D> UnwindSafe for Empty<D>

Blanket Implementations

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

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

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

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

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

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

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

pub fn from(t: T) -> T[src]

Performs the conversion.

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

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

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.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

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.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.