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§
Sourcefn interface_name(&self) -> &str
fn interface_name(&self) -> &str
Get the interface name (e.g., “mensa.user.v1.UserInterface”)
Sourcefn method_names(&self) -> &[&'static str]
fn method_names(&self) -> &[&'static str]
Get the list of method names
Sourcefn handle<'life0, 'async_trait>(
&'life0 self,
request: RpcRequest,
) -> Pin<Box<dyn Future<Output = RpcResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
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