Trait netapp::endpoint::EndpointHandler [−][src]
pub trait EndpointHandler<M>: Send + Sync where
M: Message, {
fn handle<'life0, 'life1, 'async_trait>(
self: &'life0 Arc<Self>,
m: &'life1 M,
from: NodeID
) -> Pin<Box<dyn Future<Output = M::Response> + Send + 'async_trait>>
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
.
The handler object should be in an Arc, see Endpoint::set_handler
Required methods
Implementations on Foreign Types
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.