Trait OptionalFromJobCallParts

Source
pub trait OptionalFromJobCallParts<Ctx>: Sized {
    type Rejection: IntoJobResult;

    // Required method
    fn from_job_call_parts(
        parts: &mut Parts,
        ctx: &Ctx,
    ) -> impl Future<Output = Result<Option<Self>, Self::Rejection>> + Send;
}
Expand description

Customize the behavior of Option<Self> as a FromJobCallParts extractor.

Required Associated Types§

Source

type Rejection: IntoJobResult

If the extractor fails, it will use this “rejection” type.

A rejection is a kind of error that can be converted into a job result.

Required Methods§

Source

fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> impl Future<Output = Result<Option<Self>, Self::Rejection>> + 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<Ctx, T> OptionalFromJobCallParts<Ctx> for Extension<T>
where T: Send + Sync + Clone + 'static, Ctx: Send + Sync + 'static,