ExtractFrom

Trait ExtractFrom 

Source
pub trait ExtractFrom<Req: ?Sized>: Sized {
    type Error;
    type Future: Future<Output = Result<Self, Self::Error>>;

    // Required method
    fn extract_from(req: Req) -> Self::Future;
}

Required Associated Types§

Source

type Error

Source

type Future: Future<Output = Result<Self, Self::Error>>

Required Methods§

Source

fn extract_from(req: Req) -> Self::Future

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.

Implementations on Foreign Types§

Source§

impl<'a, B> ExtractFrom<Request<B>> for Bytes
where B: HttpBody + Send + 'static, B::Data: Send,

Source§

type Error = <B as Body>::Error

Source§

type Future = Pin<Box<dyn Future<Output = Result<Bytes, <Bytes as ExtractFrom<Request<B>>>::Error>> + Send>>

Source§

fn extract_from(req: Request<B>) -> Self::Future

Implementors§

Source§

impl<'a, T> ExtractFrom<&'a Bytes> for Json<T>
where T: Deserialize<'a>,

Source§

impl<T, B> ExtractFrom<Request<B>> for Json<T>
where T: DeserializeOwned, B: HttpBody + Send + 'static, B::Data: Send,

Source§

type Error = Error<B>

Source§

type Future = Pin<Box<dyn Future<Output = Result<Json<T>, <Json<T> as ExtractFrom<Request<B>>>::Error>> + Send>>