Skip to main content

RpcInterface

Trait RpcInterface 

Source
pub trait RpcInterface: Send + Sync {
    // Required methods
    fn interface_name(&self) -> &str;
    fn method_names(&self) -> &[&'static str];
    fn handle<'life0, 'async_trait>(
        &'life0 self,
        request: RpcRequest,
    ) -> Pin<Box<dyn Future<Output = RpcResponse> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Trait for implementing RPC interfaces

Required Methods§

Source

fn interface_name(&self) -> &str

Get the interface name (e.g., “mensa.user.v1.UserInterface”)

Source

fn method_names(&self) -> &[&'static str]

Get the list of method names

Source

fn handle<'life0, 'async_trait>( &'life0 self, request: RpcRequest, ) -> Pin<Box<dyn Future<Output = RpcResponse> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handle an RPC request

Implementors§