Enum actix_web::Body

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

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.

Implementations

Does this body streaming.

Is this binary body.

Is this binary empy.

Create body from slice (copy)

Trait Implementations

Formats the value using the given formatter. Read more
Converts to this type from the input type.
Converts to this type from the input type.
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.