[][src]Trait service::World

pub trait World: Clone {
    type HelloFut: Future<Output = String>;
    pub fn hello(self, context: Context, name: String) -> Self::HelloFut;

    pub fn serve(self) -> ServeWorld<Self> { ... }
}

This is the service definition. It looks a lot like a trait definition. It defines one RPC, hello, which takes one arg, name, and returns a String.

Associated Types

type HelloFut: Future<Output = String>[src]

The response future returned by hello.

Loading content...

Required methods

pub fn hello(self, context: Context, name: String) -> Self::HelloFut[src]

Returns a greeting for name.

Loading content...

Provided methods

pub fn serve(self) -> ServeWorld<Self>[src]

Returns a serving function to use with tarpc::server::Channel::respond_with.

Loading content...

Implementors

Loading content...