Trait linera_rpc::simple::MessageHandler
source · pub trait MessageHandler: Clone {
// Required method
fn handle_message<'life0, 'async_trait>(
&'life0 mut self,
message: RpcMessage,
) -> Pin<Box<dyn Future<Output = Option<RpcMessage>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}
Expand description
The handler required to create a service.
The implementation needs to implement Clone
because a seed instance is used to generate
cloned instances, where each cloned instance handles a single request. Multiple cloned instances
may exist at the same time and handle separate requests concurrently.
Required Methods§
fn handle_message<'life0, 'async_trait>(
&'life0 mut self,
message: RpcMessage,
) -> Pin<Box<dyn Future<Output = Option<RpcMessage>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Object Safety§
This trait is not object safe.