Skip to main content

FromRequest

Trait FromRequest 

Source
pub trait FromRequest:
    Sized
    + Send
    + 'static {
    type Rejection: IntoResponse + Send + 'static;

    // Required method
    fn from_request(request: &Request) -> Result<Self, Self::Rejection>;
}

Required Associated Types§

Required Methods§

Source

fn from_request(request: &Request) -> Result<Self, Self::Rejection>

Extract a strongly typed value from a normalized request.

Buffered body extractors read Request::body. RequestBodyStream takes the one-shot body slot of a streaming route.

§Errors

Returns a typed rejection when the request cannot be converted into the requested value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§