Trait FromJobCall

Source
pub trait FromJobCall<Ctx, M = ViaJobCall>: Sized {
    type Rejection: IntoJobResult;

    // Required method
    fn from_job_call(
        call: JobCall,
        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( call: JobCall, 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> FromJobCall<Ctx> for String
where Ctx: Send + Sync,

Source§

type Rejection = InvalidUtf8

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx> FromJobCall<Ctx> for BytesMut
where Ctx: Send + Sync,

Source§

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

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

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

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

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

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

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

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, 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> FromJobCall<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: FromJobCall<Ctx> + Send, Ctx: Send + Sync,

Source§

type Rejection = Option<JobResult>

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Source§

impl<Ctx, T> FromJobCall<Ctx> for Option<T>
where T: OptionalFromJobCall<Ctx>, Ctx: Send + Sync,

Source§

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

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Option<T>, Self::Rejection>

Source§

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

Source§

type Rejection = Infallible

Source§

async fn from_job_call( call: JobCall, ctx: &Ctx, ) -> Result<Self, Self::Rejection>

Implementors§

Source§

impl<Ctx> FromJobCall<Ctx> for JobCall
where Ctx: Send + Sync,

Source§

impl<Ctx> FromJobCall<Ctx> for Bytes
where Ctx: Send + Sync,