[][src]Enum conduit::Body

pub enum Body {
    Static(&'static [u8]),
    Owned(Vec<u8>),
    File(File),
}

A type representing a Response body.

This type is intended exclusively for use as part of a Response<Body>. Each conduit server provides its own request type that implements RequestExt which provides the request body as a &'a mut dyn Read.

Variants

Owned(Vec<u8>)
File(File)

Implementations

impl Body[src]

pub fn empty() -> Self[src]

Create a new Body from an empty static slice.

pub fn from_static(bytes: &'static [u8]) -> Self[src]

Create a new Body from the provided static byte slice.

pub fn from_vec(bytes: Vec<u8>) -> Self[src]

Create a new Body by taking ownership of the provided bytes.

Auto Trait Implementations

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, 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.