pub trait TryFromBody {
    type Error: IntoResponse;

    // Required method
    fn try_from_body(body: Vec<u8>) -> Result<Self, Self::Error>
       where Self: Sized;
}
Expand description

A trait for converting from a body or failing

Required Associated Types§

source

type Error: IntoResponse

The error encountered if conversion fails

Required Methods§

source

fn try_from_body(body: Vec<u8>) -> Result<Self, Self::Error>
where Self: Sized,

Convert from a body to Self or fail

Implementations on Foreign Types§

source§

impl TryFromBody for String

§

type Error = NonUtf8BodyError

source§

fn try_from_body(body: Vec<u8>) -> Result<Self, Self::Error>
where Self: Sized,

source§

impl<T: TryFromBody> TryFromBody for Option<T>

§

type Error = <T as TryFromBody>::Error

source§

fn try_from_body(body: Vec<u8>) -> Result<Self, Self::Error>
where Self: Sized,

Implementors§