pub trait World: Sized {
// Required method
async fn hello(self, context: Context, name: String) -> String;
// 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 Methods§
Provided Methods§
Sourcefn serve(self) -> ServeWorld<Self>
fn serve(self) -> ServeWorld<Self>
Returns a serving function to use with InFlightRequest::execute.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.