pub struct StateMachine<Tag>{ /* private fields */ }Expand description
State machine data structure to store state sources and handles.
Implementations§
Source§impl<Tag> StateMachine<Tag>
impl<Tag> StateMachine<Tag>
pub fn new() -> Self
Sourcepub async fn source<S>(&self, tag: Tag) -> Source<S>where
S: 'static + Clone,
pub async fn source<S>(&self, tag: Tag) -> Source<S>where
S: 'static + Clone,
Get source from state machine by tag.
Sourcepub async fn source_value<S>(&self, tag: Tag) -> Option<S>
pub async fn source_value<S>(&self, tag: Tag) -> Option<S>
Get current value of source from state machine by tag.
Sourcepub async fn handle<T>(&self, tag: Tag) -> Handle<T>where
T: 'static + Clone,
pub async fn handle<T>(&self, tag: Tag) -> Handle<T>where
T: 'static + Clone,
Get handle from state machine.
Sourcepub async fn handle_value<T>(&self, tag: Tag) -> Option<T>
pub async fn handle_value<T>(&self, tag: Tag) -> Option<T>
Get current value of handle from state machine.
Trait Implementations§
Source§impl<Tag> Clone for StateMachine<Tag>
impl<Tag> Clone for StateMachine<Tag>
Source§fn clone(&self) -> StateMachine<Tag>
fn clone(&self) -> StateMachine<Tag>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<Tag> Debug for StateMachine<Tag>
impl<Tag> Debug for StateMachine<Tag>
Auto Trait Implementations§
impl<Tag> !RefUnwindSafe for StateMachine<Tag>
impl<Tag> !UnwindSafe for StateMachine<Tag>
impl<Tag> Freeze for StateMachine<Tag>
impl<Tag> Send for StateMachine<Tag>
impl<Tag> Sync for StateMachine<Tag>
impl<Tag> Unpin for StateMachine<Tag>
impl<Tag> UnsafeUnpin for StateMachine<Tag>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more