[][src]Trait tarpc_lib::server::Handler

pub trait Handler<T, Req, Resp> where
    Self: Sized + Stream<Item = Result<Channel<Req, Resp, T>>>,
    Req: Send,
    Resp: Send,
    T: Transport<Item = ClientMessage<Req>, SinkItem = Response<Resp>> + Send
{ fn respond_with<F, Fut>(self, request_handler: F) -> Running<Self, F>
    where
        F: FnOnce(Context, Req) -> Fut + Send + 'static + Clone,
        Fut: Future<Output = Result<Resp>> + Send + 'static
, { ... } }

A utility trait enabling a stream to fluently chain a request handler.

Provided methods

Important traits for Running<S, F>
fn respond_with<F, Fut>(self, request_handler: F) -> Running<Self, F> where
    F: FnOnce(Context, Req) -> Fut + Send + 'static + Clone,
    Fut: Future<Output = Result<Resp>> + Send + 'static, 

Responds to all requests with request_handler.

Loading content...

Implementors

impl<T, Req, Resp, S> Handler<T, Req, Resp> for S where
    S: Sized + Stream<Item = Result<Channel<Req, Resp, T>>>,
    Req: Send,
    Resp: Send,
    T: Transport<Item = ClientMessage<Req>, SinkItem = Response<Resp>> + Send
[src]

Important traits for Running<S, F>
fn respond_with<F, Fut>(self, request_handler: F) -> Running<Self, F> where
    F: FnOnce(Context, Req) -> Fut + Send + 'static + Clone,
    Fut: Future<Output = Result<Resp>> + Send + 'static, 
[src]

Loading content...