Trait serv::reply::Reply

source ·
pub trait Reply<T, E>: Serialize + From<Result<T, E>>where
    T: Serialize + 'static,
    E: From<Error> + 'static,
{ fn reply(&self, status: StatusCode) -> HyperFuture { ... } fn serv_state<F, S, Req>(state: S, f: F) -> HyperService
    where
        Self: 'static,
        F: for<'a> Fn(&'a S, Req) -> Box<dyn Future<Item = T, Error = E>> + 'static,
        S: 'static,
        Req: for<'de> Deserialize<'de> + 'static
, { ... } fn serv<F, Req>(f: F) -> HyperService
    where
        Self: 'static,
        F: Fn(Req) -> Box<dyn Future<Item = T, Error = E>> + 'static,
        Req: for<'de> Deserialize<'de> + 'static
, { ... } fn serv_state_sync<F, S, Req>(state: S, f: F) -> HyperService
    where
        Self: 'static,
        F: for<'a> Fn(&'a S, Req) -> Result<T, E> + 'static,
        S: 'static,
        Req: for<'de> Deserialize<'de> + 'static
, { ... } fn serv_sync<F, Req>(f: F) -> HyperService
    where
        Self: 'static,
        F: Fn(Req) -> Result<T, E> + 'static,
        Req: for<'de> Deserialize<'de> + 'static
, { ... } }
Expand description

Oneshot-style reply which contains response or error.

Provided Methods§

write reply body

serv_state build HyperService with given function F and state S.

service builds HyperService with given function F.

serv_state builds HyperService with given function F and state S.

serv build HyperService with given function F.

Implementors§