Trait safe_vk::handler::Handler

source ·
pub trait Handler<T, S>: Clone + Send + Sized + 'static {
    type Future: Future<Output = ()> + Send + 'static;

    // Required method
    fn call(
        self,
        update: Update,
        state: S,
        request: Arc<RequestBuilder>
    ) -> Self::Future;

    // Provided method
    fn with_state(self, state: S) -> HandlerService<Self, T, S> { ... }
}

Required Associated Types§

source

type Future: Future<Output = ()> + Send + 'static

Required Methods§

source

fn call( self, update: Update, state: S, request: Arc<RequestBuilder> ) -> Self::Future

Provided Methods§

source

fn with_state(self, state: S) -> HandlerService<Self, T, S>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<F, Fut, S> Handler<((),), S> for F
where F: FnOnce() -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1> Handler<(M, T1), S> for F
where F: FnOnce(T1) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2> Handler<(M, T1, T2), S> for F
where F: FnOnce(T1, T2) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3> Handler<(M, T1, T2, T3), S> for F
where F: FnOnce(T1, T2, T3) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4> Handler<(M, T1, T2, T3, T4), S> for F
where F: FnOnce(T1, T2, T3, T4) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5> Handler<(M, T1, T2, T3, T4, T5), S> for F
where F: FnOnce(T1, T2, T3, T4, T5) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6> Handler<(M, T1, T2, T3, T4, T5, T6), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7> Handler<(M, T1, T2, T3, T4, T5, T6, T7), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7, T8> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdateParts<S> + Send, T8: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7, T8, T9> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdateParts<S> + Send, T8: FromUpdateParts<S> + Send, T9: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdateParts<S> + Send, T8: FromUpdateParts<S> + Send, T9: FromUpdateParts<S> + Send, T10: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdateParts<S> + Send, T8: FromUpdateParts<S> + Send, T9: FromUpdateParts<S> + Send, T10: FromUpdateParts<S> + Send, T11: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdateParts<S> + Send, T8: FromUpdateParts<S> + Send, T9: FromUpdateParts<S> + Send, T10: FromUpdateParts<S> + Send, T11: FromUpdateParts<S> + Send, T12: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdateParts<S> + Send, T8: FromUpdateParts<S> + Send, T9: FromUpdateParts<S> + Send, T10: FromUpdateParts<S> + Send, T11: FromUpdateParts<S> + Send, T12: FromUpdateParts<S> + Send, T13: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdateParts<S> + Send, T8: FromUpdateParts<S> + Send, T9: FromUpdateParts<S> + Send, T10: FromUpdateParts<S> + Send, T11: FromUpdateParts<S> + Send, T12: FromUpdateParts<S> + Send, T13: FromUpdateParts<S> + Send, T14: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdateParts<S> + Send, T8: FromUpdateParts<S> + Send, T9: FromUpdateParts<S> + Send, T10: FromUpdateParts<S> + Send, T11: FromUpdateParts<S> + Send, T12: FromUpdateParts<S> + Send, T13: FromUpdateParts<S> + Send, T14: FromUpdateParts<S> + Send, T15: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>

source§

impl<F, Fut, S, M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16> Handler<(M, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16), S> for F
where F: FnOnce(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16) -> Fut + Clone + Send + 'static, Fut: Future<Output = ()> + Send, S: Send + Sync + 'static, T1: FromUpdateParts<S> + Send, T2: FromUpdateParts<S> + Send, T3: FromUpdateParts<S> + Send, T4: FromUpdateParts<S> + Send, T5: FromUpdateParts<S> + Send, T6: FromUpdateParts<S> + Send, T7: FromUpdateParts<S> + Send, T8: FromUpdateParts<S> + Send, T9: FromUpdateParts<S> + Send, T10: FromUpdateParts<S> + Send, T11: FromUpdateParts<S> + Send, T12: FromUpdateParts<S> + Send, T13: FromUpdateParts<S> + Send, T14: FromUpdateParts<S> + Send, T15: FromUpdateParts<S> + Send, T16: FromUpdate<S, M> + Send,

§

type Future = Pin<Box<dyn Future<Output = ()> + Send>>