Trait FromJobCallParts

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

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

Types that can be created from job calls.

Extractors that implement FromJobCall can consume the job call body and can thus only be run once for jobs.

If your extractor doesn’t need to consume the job call body then you should implement FromJobCallParts and not FromJobCall.

See blueprint_sdk::extract for more general docs about extractors.

Required Associated Types§

Source

type Rejection: IntoJobResult

If the extractor fails it’ll 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<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.

Implementations on Foreign Types§

Source§

impl<Ctx> FromJobCallParts<Ctx> for ()
where Ctx: Send + Sync,

Source§

impl<Ctx, T1> FromJobCallParts<Ctx> for (T1,)
where T1: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2> FromJobCallParts<Ctx> for (T1, T2)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3> FromJobCallParts<Ctx> for (T1, T2, T3)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4> FromJobCallParts<Ctx> for (T1, T2, T3, T4)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7, T8)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, T8: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7, T8, T9)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, T8: FromJobCallParts<Ctx> + Send, T9: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, T8: FromJobCallParts<Ctx> + Send, T9: FromJobCallParts<Ctx> + Send, T10: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, T8: FromJobCallParts<Ctx> + Send, T9: FromJobCallParts<Ctx> + Send, T10: FromJobCallParts<Ctx> + Send, T11: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, T8: FromJobCallParts<Ctx> + Send, T9: FromJobCallParts<Ctx> + Send, T10: FromJobCallParts<Ctx> + Send, T11: FromJobCallParts<Ctx> + Send, T12: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, T8: FromJobCallParts<Ctx> + Send, T9: FromJobCallParts<Ctx> + Send, T10: FromJobCallParts<Ctx> + Send, T11: FromJobCallParts<Ctx> + Send, T12: FromJobCallParts<Ctx> + Send, T13: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, T8: FromJobCallParts<Ctx> + Send, T9: FromJobCallParts<Ctx> + Send, T10: FromJobCallParts<Ctx> + Send, T11: FromJobCallParts<Ctx> + Send, T12: FromJobCallParts<Ctx> + Send, T13: FromJobCallParts<Ctx> + Send, T14: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, T8: FromJobCallParts<Ctx> + Send, T9: FromJobCallParts<Ctx> + Send, T10: FromJobCallParts<Ctx> + Send, T11: FromJobCallParts<Ctx> + Send, T12: FromJobCallParts<Ctx> + Send, T13: FromJobCallParts<Ctx> + Send, T14: FromJobCallParts<Ctx> + Send, T15: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromJobCallParts<Ctx> for (T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16)
where T1: FromJobCallParts<Ctx> + Send, T2: FromJobCallParts<Ctx> + Send, T3: FromJobCallParts<Ctx> + Send, T4: FromJobCallParts<Ctx> + Send, T5: FromJobCallParts<Ctx> + Send, T6: FromJobCallParts<Ctx> + Send, T7: FromJobCallParts<Ctx> + Send, T8: FromJobCallParts<Ctx> + Send, T9: FromJobCallParts<Ctx> + Send, T10: FromJobCallParts<Ctx> + Send, T11: FromJobCallParts<Ctx> + Send, T12: FromJobCallParts<Ctx> + Send, T13: FromJobCallParts<Ctx> + Send, T14: FromJobCallParts<Ctx> + Send, T15: FromJobCallParts<Ctx> + Send, T16: FromJobCallParts<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T> FromJobCallParts<Ctx> for Option<T>
where T: OptionalFromJobCallParts<Ctx>, Ctx: Send + Sync,

Source§

type Rejection = <T as OptionalFromJobCallParts<Ctx>>::Rejection

Source§

fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> impl Future<Output = Result<Option<T>, Self::Rejection>>

Source§

impl<Ctx, T> FromJobCallParts<Ctx> for Result<T, T::Rejection>
where T: FromJobCallParts<Ctx>, Ctx: Send + Sync,

Source§

type Rejection = Infallible

Source§

async fn from_job_call_parts( parts: &mut Parts, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Implementors§

Source§

impl<Ctx> FromJobCallParts<Ctx> for Parts
where Ctx: Send + Sync,

Source§

impl<Ctx> FromJobCallParts<Ctx> for MetadataMap<MetadataValue>
where Ctx: Send + Sync,

Source§

impl<Ctx> FromJobCallParts<Ctx> for Metadata
where Ctx: Send + Sync + 'static,

Source§

impl<Ctx, T> FromJobCallParts<Ctx> for Extension<T>
where T: Send + Sync + Clone + 'static, Ctx: Send + Sync + 'static,

Source§

impl<OuterContext, InnerContext> FromJobCallParts<OuterContext> for Context<InnerContext>
where InnerContext: FromRef<OuterContext>, OuterContext: Send + Sync,

Source§

impl<T, Ctx> FromJobCallParts<Ctx> for JobId<T>
where T: TryFrom<JobId>, <T as TryFrom<JobId>>::Error: IntoJobResult, Ctx: Send + Sync + 'static,