Trait sfsm::PollMessage[][src]

pub trait PollMessage<State, Message>: Machine {
    fn poll_message(&mut self) -> Result<Option<Message>, MessageError<()>>;
}
Expand description

The PollMessage trait implementation will be generated by the add_message! macro and is used to return messages from states.

 use sfsm_base::PollMessage;
 let some_message = PollMessage::<FooState, FooMessage>::poll_message(&mut sfsm);

This will call the return_message function of ‘FooState’ if it implemented the ReturnMessage trait for message ‘FooMessage’ and it has been declared to do so with the add_message! macro.

Required methods

Implementors