PollMessage

Trait PollMessage 

Source
pub trait PollMessage<TargetState, Message>: StateMachine
where TargetState: State + ReturnMessage<Message>,
{ // Required method 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.

Required Methods§

Source

fn poll_message(&mut self) -> Result<Option<Message>, MessageError<()>>

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.

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

Implementors§