salish 0.1.0-dev.1

Messaging Library
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
use crate::traits::Payload;

/// Message Handler Trait
pub trait MessageHandler: std::fmt::Debug {
    /// Payload type this handler is receiving
    type Message: Payload;

    /// The return type of the message handler
    type Return;

    fn on_message<'b>(&'b mut self, message: &'b Self::Message) -> Self::Return;
}