Enum ajars_actix_web::actix_web::body::AnyBody [−]
pub enum AnyBody {
None,
Empty,
Bytes(Bytes),
Message(BoxAnyBody),
}
Expand description
Represents various types of HTTP message body.
Variants
Empty response. Content-Length
header is not set.
Zero sized response body. Content-Length
header is set to 0
.
Bytes(Bytes)
Specific response body.
Message(BoxAnyBody)
Generic message body.
Implementations
impl AnyBody
impl AnyBody
pub fn from_slice(s: &[u8]) -> AnyBody
pub fn from_slice(s: &[u8]) -> AnyBody
Create body from slice (copy)
pub fn from_message<B>(body: B) -> AnyBody where
B: MessageBody + 'static,
<B as MessageBody>::Error: Into<Box<dyn Error + 'static, Global>>,
pub fn from_message<B>(body: B) -> AnyBody where
B: MessageBody + 'static,
<B as MessageBody>::Error: Into<Box<dyn Error + 'static, Global>>,
Create body from generic message body.
Trait Implementations
impl From<&'static [u8]> for AnyBody
impl From<&'static [u8]> for AnyBody
pub fn from(s: &'static [u8]) -> AnyBody
pub fn from(s: &'static [u8]) -> AnyBody
Performs the conversion.
pub fn from(s: BodyStream<S>) -> AnyBody
pub fn from(s: BodyStream<S>) -> AnyBody
Performs the conversion.
pub fn from(s: SizedStream<S>) -> AnyBody
pub fn from(s: SizedStream<S>) -> AnyBody
Performs the conversion.