[][src]Trait service::World

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

    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>

The response future returned by hello.

Loading content...

Required methods

fn hello(self, context: Context, name: String) -> Self::HelloFut

Returns a greeting for name.

Loading content...

Provided methods

fn serve(self) -> ServeWorld<Self>

Returns a serving function to use with tarpc::server::Server.

Loading content...

Implementors

Loading content...