pub trait HandleMessage {
type Message: Serialize + DeserializeOwned + Send + Sync + 'static;
type Error: Error + 'static;
// Required method
fn handle_message(
&mut self,
msg: Envelope<Self::Message>,
outbound_msg_tx: Sender<Envelope<Self::Message>>,
) -> Result<(), Self::Error>;
}
Expand description
A single node should be able to handle messages of a given type, and return an error if something goes wrong.