Skip to main content

FromRequest

Trait FromRequest 

Source
pub trait FromRequest<Task>: Sized {
    type Error;

    // Required method
    fn from_request(
        req: &Task,
    ) -> impl Future<Output = Result<Self, Self::Error>> + Send;
}
Expand description

A trait for extracting types from a task’s context.

Required Associated Types§

Source

type Error

The error type that can occur during extraction.

Required Methods§

Source

fn from_request( req: &Task, ) -> impl Future<Output = Result<Self, Self::Error>> + Send

Perform the extraction.

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<F: FromRequest<T>, T: Sync> FromRequest<T> for Option<F>

Source§

type Error = <F as FromRequest<T>>::Error

Source§

async fn from_request(req: &T) -> Result<Self, Self::Error>

Implementors§

Source§

impl<Args: Send + Sync> FromRequest<Task<Args>> for MetadataStore

Source§

impl<Args: Sync, Res> FromRequest<Task<Args>> for TaskRunner<Res>

Source§

impl<Args: Sync> FromRequest<Task<Args>> for TaskContext

Available on crate feature task-context only.
Source§

impl<Args: Sync> FromRequest<Task<Args>> for TaskId

Source§

impl<Args: Sync> FromRequest<Task<Args>> for WorkerContext

Source§

impl<Args> FromRequest<Task<Args>> for Attempt
where Args: Sync,

Source§

impl<Args> FromRequest<Task<Args>> for Queue
where Args: Sync,

Source§

impl<T: Clone + Send + Sync + 'static, Args: Sync> FromRequest<Task<Args>> for Data<T>

Source§

impl<T: Metadata, Args: Send + Sync> FromRequest<Task<Args>> for Meta<T>