Trait service::World

source ·
pub trait World: Sized {
    type HelloFut: Future<Output = String>;

    // Required method
    fn hello(self, context: Context, name: String) -> Self::HelloFut;

    // Provided method
    fn serve(self) -> ServeWorld<Self> { ... }
}
Expand description

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.

Required Associated Types§

source

type HelloFut: Future<Output = String>

The response future returned by World::hello.

Required Methods§

source

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

Returns a greeting for name.

Provided Methods§

source

fn serve(self) -> ServeWorld<Self>

Returns a serving function to use with InFlightRequest::execute.

Implementors§