pub trait FromRequest:
Sized
+ Send
+ 'static {
// Required method
fn from_request(request: Arc<Request>) -> BoxedFuture<Result<Self>>;
}Expand description
Something a handler parameter can be built from.
Required Methods§
Sourcefn from_request(request: Arc<Request>) -> BoxedFuture<Result<Self>>
fn from_request(request: Arc<Request>) -> BoxedFuture<Result<Self>>
Build Self from the request, or fail with the error the client should
see (a 400 for a malformed body, a 422 for a failed contract).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl FromRequest for Arc<Request>
The whole request.
impl FromRequest for Arc<Request>
The whole request.
fn from_request(request: Arc<Request>) -> BoxedFuture<Result<Self>>
Source§impl<T: FromRequest> FromRequest for Option<T>
An extractor that never fails: Option<T> is None when T would have
errored. For inputs that are genuinely optional.
impl<T: FromRequest> FromRequest for Option<T>
An extractor that never fails: Option<T> is None when T would have
errored. For inputs that are genuinely optional.
fn from_request(request: Arc<Request>) -> BoxedFuture<Result<Self>>
Source§impl<T: FromRequest> FromRequest for Result<T>
Hands the extraction error to the handler instead of short-circuiting, for
actions that want to answer a bad request themselves.
impl<T: FromRequest> FromRequest for Result<T>
Hands the extraction error to the handler instead of short-circuiting, for actions that want to answer a bad request themselves.