Skip to main content

IntoBody

Trait IntoBody 

Source
pub trait IntoBody: Body {
    // Required method
    fn into_body(self) -> Result<Vec<u8>>;
}
Expand description

Implemented by the Reply::body to convert itself into a format compatible with [IntoResponse].

Required Methods§

Source

fn into_body(self) -> Result<Vec<u8>>

Convert implementing type into an http-compatible body.

§Errors

Returns an error if the body cannot be encoded (for example, if JSON serialization fails).

Implementors§