Trait World

Source
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§

Source

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

Returns a greeting for name.

Provided Methods§

Source

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.

Implementors§