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§
sourcetype HelloFut: Future<Output = String>
type HelloFut: Future<Output = String>
The response future returned by World::hello
.
Required Methods§
Provided Methods§
sourcefn serve(self) -> ServeWorld<Self>
fn serve(self) -> ServeWorld<Self>
Returns a serving function to use with InFlightRequest::execute.