Skip to main content

HandlerSt

Trait HandlerSt 

Source
pub trait HandlerSt<St, U, T>: 'static
where St: State,
{ type Output: Responder<St>; // Required method async fn call(&self, st: &St, req: U, param: T) -> Self::Output; }
Expand description

Async fn handler that receives the application and request state.

Implemented for async functions and closures whose first two arguments are the application state &St and the request state U, followed by up to 16 extractors. T is the tuple of extractor types. Register such handlers with Route::to_with_state().

Required Associated Types§

Source

type Output: Responder<St>

Handler result, converted into a response.

Required Methods§

Source

async fn call(&self, st: &St, req: U, param: T) -> Self::Output

Call the handler with the states and extracted values.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<St, Func, U, T0, Res> HandlerSt<St, U, (T0,)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, Res> HandlerSt<St, U, (T0, T1)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, Res> HandlerSt<St, U, (T0, T1, T2)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, Res> HandlerSt<St, U, (T0, T1, T2, T3)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, T7, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6, T7)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6, T7) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6, T7, T8)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6, T7, T8) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, Func, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, Res> HandlerSt<St, U, (T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15)> for Func
where St: State, Func: 'static + AsyncFn(&St, U, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) -> Res, Res: Responder<St>,

Source§

type Output = Res

Source§

impl<St, U, F, R> HandlerSt<St, U, ()> for F
where F: AsyncFn(&St, U) -> R + 'static, R: Responder<St>, St: State,