Trait ReceiveMessage

Source
pub trait ReceiveMessage<Message> {
    // Required method
    fn receive_message(&mut self, message: Message);
}
Expand description

Trait to handle an incoming message

Implement this trait for a state that can receive a message according to the add_message definition. Note: for the state to actually be able to receive a message, the message has to be added with the add_message!

Required Methods§

Source

fn receive_message(&mut self, message: Message)

Receive a message when a message for the corresponding state is pushed into the state machine

    fn receive_message(&mut self, message: Message) {
        println!("Got a message {:?}", message);
    }

Implementors§