pub trait FromRequest: Sized {
// Required method
fn from_request<'life0, 'async_trait>(
ctx: &'life0 Context,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Expand description
A type that can be extracted from the request context.
Every extractor borrows &Context; the request body is buffered and cached,
so multiple body-reading extractors on the same handler are fine.
Required Methods§
fn from_request<'life0, 'async_trait>(
ctx: &'life0 Context,
) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl FromRequest for Context
The full request context — the identity extractor, so existing
|ctx: Context| async move { … } handlers keep working unchanged.