Trait sfsm_base::message::__protected::PollMessage [−][src]
pub trait PollMessage<TargetState, Message>: StateMachine where
TargetState: State + ReturnMessage<Message>, {
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
fn poll_message(&mut self) -> Result<Option<Message>, MessageError<()>>
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);