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

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

    fn method(&self, _request: &Req) -> Option<&'static str> { ... }
}

Equivalent to a FnOnce(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

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

Responds to a single request.

Loading content...

Provided methods

fn method(&self, _request: &Req) -> Option<&'static str>[src]

Extracts a method name from the request.

Loading content...

Implementors

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

type Resp = Resp

type Fut = Fut

Loading content...