pub struct StateMachine<G>{ /* private fields */ }Expand description
State machine data structure to store state sources and handles.
- G - to distinguish different initiators or responders.
Implementations§
Source§impl<G> StateMachine<G>
impl<G> StateMachine<G>
pub fn new() -> Self
Sourcepub async fn source<S>(&self, tag: G) -> Source<S>where
S: 'static + Clone,
pub async fn source<S>(&self, tag: G) -> Source<S>where
S: 'static + Clone,
Get source from state machine by tag.
Sourcepub async fn source_value<S>(&self, tag: G) -> S
pub async fn source_value<S>(&self, tag: G) -> S
Get current value of source from state machine by tag.
Sourcepub async fn handle<T>(&self, tag: G) -> Handle<T>where
T: 'static + Clone,
pub async fn handle<T>(&self, tag: G) -> Handle<T>where
T: 'static + Clone,
Get handle from state machine.
Sourcepub async fn handle_value<T>(&self, tag: G) -> T
pub async fn handle_value<T>(&self, tag: G) -> T
Get current value of handle from state machine.
Trait Implementations§
Source§impl<G> Clone for StateMachine<G>
impl<G> Clone for StateMachine<G>
Source§fn clone(&self) -> StateMachine<G>
fn clone(&self) -> StateMachine<G>
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<G> Debug for StateMachine<G>
impl<G> Debug for StateMachine<G>
Auto Trait Implementations§
impl<G> !RefUnwindSafe for StateMachine<G>
impl<G> !UnwindSafe for StateMachine<G>
impl<G> Freeze for StateMachine<G>
impl<G> Send for StateMachine<G>
impl<G> Sync for StateMachine<G>
impl<G> Unpin for StateMachine<G>
impl<G> UnsafeUnpin for StateMachine<G>
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