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", so this trait is not object safe.

Implementors§

Source§

impl<Args, Ctx, IdType> FromRequest<Task<Args, Ctx, IdType>> for Queue
where Args: Sync, Ctx: Sync, IdType: Sync + Send,

Source§

impl<Args: Sync, Ctx: Sync + Clone, IdType: Sync + Send> FromRequest<Task<Args, Ctx, IdType>> for LongRunnerCtx

Source§

impl<Args: Sync, Ctx: Sync, IdType: Sync + Send + Clone> FromRequest<Task<Args, Ctx, IdType>> for TaskId<IdType>

Source§

impl<Args: Sync, Ctx: Sync, IdType: Sync + Send> FromRequest<Task<Args, Ctx, IdType>> for Attempt

Source§

impl<Args: Sync, Ctx: Sync, IdType: Sync + Send> FromRequest<Task<Args, Ctx, IdType>> for WorkerContext

Source§

impl<T, Args: Send + Sync, Ctx: MetadataExt<T> + Send + Sync, IdType: Send + Sync> FromRequest<Task<Args, Ctx, IdType>> for Meta<T>

Source§

type Error = <Ctx as MetadataExt<T>>::Error

Source§

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