Handler

Trait Handler 

Source
pub trait Handler<Args>: 'static {
    type Output;
    type Future: Future<Output = Self::Output>;

    // Required method
    fn call(&self, args: Args) -> Self::Future;
}
Expand description

§Handler trait

The Handler trait defines the signature of a handler function that can be used to implement a service handler

Required Associated Types§

Source

type Output

The output type of the handler

Source

type Future: Future<Output = Self::Output>

The future type of the handler

Required Methods§

Source

fn call(&self, args: Args) -> Self::Future

Calls the handler function with the given arguments

Implementors§

Source§

impl<Func, Fut> Handler<()> for Func
where Func: Fn() -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A> Handler<(A,)> for Func
where Func: Fn(A) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B> Handler<(A, B)> for Func
where Func: Fn(A, B) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C> Handler<(A, B, C)> for Func
where Func: Fn(A, B, C) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D> Handler<(A, B, C, D)> for Func
where Func: Fn(A, B, C, D) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E> Handler<(A, B, C, D, E)> for Func
where Func: Fn(A, B, C, D, E) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F> Handler<(A, B, C, D, E, F)> for Func
where Func: Fn(A, B, C, D, E, F) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G> Handler<(A, B, C, D, E, F, G)> for Func
where Func: Fn(A, B, C, D, E, F, G) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H> Handler<(A, B, C, D, E, F, G, H)> for Func
where Func: Fn(A, B, C, D, E, F, G, H) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I> Handler<(A, B, C, D, E, F, G, H, I)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J> Handler<(A, B, C, D, E, F, G, H, I, J)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K> Handler<(A, B, C, D, E, F, G, H, I, J, K)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L> Handler<(A, B, C, D, E, F, G, H, I, J, K, L)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut

Source§

impl<Func, Fut, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z> Handler<(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z)> for Func
where Func: Fn(A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z) -> Fut + 'static, Fut: Future,

Source§

type Output = <Fut as Future>::Output

Source§

type Future = Fut