pub trait TryNonRequestFromRequest {
    type Error;

    // Required method
    fn try_from_request(req: Request) -> Result<Self, Self::Error>
       where Self: Sized;
}
Expand description

A hack that allows us to do blanket impls for T where T: TryFromRequest for all types T except for Request.

This is useful in wasi_http where we want to implement TryFromIncomingRequest for all types that impl TryFromRequest with the exception of Request itself. This allows that implementation to first convert the IncomingRequest to a Request and then using this trait convert from Request to the given type.

Required Associated Types§

source

type Error

The error if the conversion fails

Required Methods§

source

fn try_from_request(req: Request) -> Result<Self, Self::Error>
where Self: Sized,

Try to turn the request into the type

Implementations on Foreign Types§

source§

impl<B: TryFromBody> TryNonRequestFromRequest for Request<B>

§

type Error = <B as TryFromBody>::Error

source§

fn try_from_request(req: Request) -> Result<Self, Self::Error>

Implementors§