[][src]Trait tarpc::rpc::server::Serve

pub trait Serve<Req>: Sized + Clone {
    type Resp;
    type Fut: Future<Output = Self::Resp>;
    pub fn serve(self, ctx: Context, req: Req) -> Self::Fut;
}

Basically a Fn(Req) -> impl Future<Output = Resp>;

Associated Types

type Resp[src]

Type of response.

type Fut: Future<Output = Self::Resp>[src]

Type of response future.

Loading content...

Required methods

pub fn serve(self, ctx: Context, req: Req) -> Self::Fut[src]

Responds to a single request.

Loading content...

Implementors

impl<Req, Resp, Fut, F> Serve<Req> for F where
    F: FnOnce(Context, Req) -> Fut + Clone,
    Fut: Future<Output = Resp>, 
[src]

type Resp = Resp

type Fut = Fut

Loading content...