pub trait FromBody: Sized {
// Required method
fn from_body(body: &Body) -> Result<Self, CamelError>;
}Expand description
Convert a Body into a typed value.
Built-in implementations are provided for String, Vec<u8>, Bytes,
and serde_json::Value.
For custom types, implement this trait manually or use
[impl_from_body_via_serde!].
Required Methods§
fn from_body(body: &Body) -> Result<Self, CamelError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.