[][src]Enum actix_http::body::Body

pub enum Body {
    None,
    Empty,
    Bytes(Bytes),
    Message(Box<dyn MessageBody>),
}

Represents various types of http message body.

Variants

None

Empty response. Content-Length header is not set.

Empty

Zero sized response body. Content-Length header is set to 0.

Bytes(Bytes)

Specific response body.

Message(Box<dyn MessageBody>)

Generic message body.

Methods

impl Body[src]

pub fn from_slice(s: &[u8]) -> Body[src]

Create body from slice (copy)

pub fn from_message<B: MessageBody + 'static>(body: B) -> Body[src]

Create body from generic message body.

Trait Implementations

impl MessageBody for Body[src]

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

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

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

impl From<String> for Body[src]

impl<'a> From<&'a String> for Body[src]

impl From<Bytes> for Body[src]

impl From<BytesMut> for Body[src]

impl<S> From<SizedStream<S>> for Body where
    S: Stream<Item = Bytes, Error = Error> + 'static, 
[src]

impl<S, E> From<BodyStream<S, E>> for Body where
    S: Stream<Item = Bytes, Error = E> + 'static,
    E: Into<Error> + 'static, 
[src]

impl PartialEq<Body> for Body[src]

#[must_use] fn ne(&self, other: &Rhs) -> bool1.0.0[src]

This method tests for !=.

impl Debug for Body[src]

Auto Trait Implementations

impl !Sync for Body

impl !Send for Body

impl Unpin for Body

impl !RefUnwindSafe for Body

impl !UnwindSafe for Body

Blanket Implementations

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.

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

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

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

impl<T> Erased for T

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,