[][src]Enum actix_web::Body

pub enum Body {
    Empty,
    Binary(Binary),
    Streaming(BodyStream),
    Actor(Box<dyn ActorHttpContext>),
}

Represents various types of http message body.

Variants

Empty

Empty response. Content-Length header is set to 0

Binary(Binary)

Specific response body.

Streaming(BodyStream)

Unspecified streaming response. Developer is responsible for setting right Content-Length or Transfer-Encoding headers.

Actor(Box<dyn ActorHttpContext>)

Special body type for actor response.

Methods

impl Body[src]

pub fn is_streaming(&self) -> bool[src]

Does this body streaming.

pub fn is_binary(&self) -> bool[src]

Is this binary body.

pub fn is_empty(&self) -> bool[src]

Is this binary empy.

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

Create body from slice (copy)

Trait Implementations

impl PartialEq<Body> for Body[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

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

impl From<Box<dyn ActorHttpContext + 'static>> for Body[src]

impl Debug for Body[src]

Auto Trait Implementations

impl !Send for Body

impl !Sync for Body

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

impl<T, U> TryInto 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> Erased for T