pub trait ReturnMessage<Message> {
    fn return_message(&mut self) -> Option<Message>;
}
Expand description

Trait to handle an outgoing message

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

Required Methods

Return a message from a state when polled

    fn return_message(&mut self) -> Option<Message> {
        let message = Message{};
        println!("Returning a message when polled");
        return Some(message);
    }

Implementors