FromJobCall

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§

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§

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

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§

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§

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§

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§

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§

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§

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§

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§

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§

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§

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§

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§

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§

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§

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

Source§

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

Source§

type Rejection = Infallible

Source§

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

Implementors§

Source§

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

Source§

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

Source§

impl<Ctx, T1> FromJobCall<Ctx> for TangleArg<T1>
where Ctx: Send + Sync, T1: DeserializeOwned,

Source§

impl<Ctx, T1, T2> FromJobCall<Ctx> for TangleArgs2<T1, T2>
where Ctx: Send + Sync, T1: DeserializeOwned, T2: DeserializeOwned,

Source§

impl<Ctx, T1, T2, T3> FromJobCall<Ctx> for TangleArgs3<T1, T2, T3>

Source§

impl<Ctx, T1, T2, T3, T4> FromJobCall<Ctx> for TangleArgs4<T1, T2, T3, T4>

Source§

impl<Ctx, T1, T2, T3, T4, T5> FromJobCall<Ctx> for TangleArgs5<T1, T2, T3, T4, T5>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6> FromJobCall<Ctx> for TangleArgs6<T1, T2, T3, T4, T5, T6>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7> FromJobCall<Ctx> for TangleArgs7<T1, T2, T3, T4, T5, T6, T7>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8> FromJobCall<Ctx> for TangleArgs8<T1, T2, T3, T4, T5, T6, T7, T8>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9> FromJobCall<Ctx> for TangleArgs9<T1, T2, T3, T4, T5, T6, T7, T8, T9>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> FromJobCall<Ctx> for TangleArgs10<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> FromJobCall<Ctx> for TangleArgs11<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> FromJobCall<Ctx> for TangleArgs12<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> FromJobCall<Ctx> for TangleArgs13<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> FromJobCall<Ctx> for TangleArgs14<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> FromJobCall<Ctx> for TangleArgs15<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15>

Source§

impl<Ctx, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> FromJobCall<Ctx> for TangleArgs16<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16>

Source§

impl<Ctx, T> FromJobCall<Ctx, ViaParts> for T
where Ctx: Send + Sync, T: FromJobCallParts<Ctx>,