Trait garage_rpc::rpc_helper::EndpointHandler
source · pub trait EndpointHandler<M>: Send + Syncwhere
M: Message,{
fn handle<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
m: &'life1 M,
from: PublicKey
) -> Pin<Box<dyn Future<Output = <M as Message>::Response> + Send + 'async_trait, Global>>
where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
}
Expand description
This trait should be implemented by an object of your application
that can handle a message of type M
, in the cases where it doesn’t
care about attached stream in the request nor in the response.
Required Methods§
fn handle<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
m: &'life1 M,
from: PublicKey
) -> Pin<Box<dyn Future<Output = <M as Message>::Response> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Implementations on Foreign Types§
source§impl<M> EndpointHandler<M> for ()where
M: Message,
impl<M> EndpointHandler<M> for ()where
M: Message,
If one simply wants to use an endpoint in a client fashion,
without locally serving requests to that endpoint,
use the unit type ()
as the handler type:
it will panic if it is ever made to handle request.