Skip to main content

UseStateMachine

Trait UseStateMachine 

Source
pub trait UseStateMachine<Tag>: HasStateMachine<Tag>
where Tag: 'static + Clone + Debug + Eq + Hash + Send + Sync,
{ // Provided methods fn source<'life0, 'async_trait, S>( &'life0 self, tag: Tag, ) -> Pin<Box<dyn Future<Output = Source<S>> + Send + 'async_trait>> where S: 'static + Clone + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn source_value<'life0, 'async_trait, S>( &'life0 self, tag: Tag, ) -> Pin<Box<dyn Future<Output = Option<S>> + Send + 'async_trait>> where S: 'static + Clone + PartialEq + Send + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn handle<'life0, 'async_trait, T>( &'life0 self, tag: Tag, ) -> Pin<Box<dyn Future<Output = Handle<T>> + Send + 'async_trait>> where T: 'static + Clone + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn handle_value<'life0, 'async_trait, T>( &'life0 self, tag: Tag, ) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>> where T: 'static + Clone + PartialEq + Send + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait { ... } }
Expand description

Some convenient methods to use state machine. The trait is auto implemented for types implemented HasStateMachine.

Provided Methods§

Source

fn source<'life0, 'async_trait, S>( &'life0 self, tag: Tag, ) -> Pin<Box<dyn Future<Output = Source<S>> + Send + 'async_trait>>
where S: 'static + Clone + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait,

Get state source.

Source

fn source_value<'life0, 'async_trait, S>( &'life0 self, tag: Tag, ) -> Pin<Box<dyn Future<Output = Option<S>> + Send + 'async_trait>>
where S: 'static + Clone + PartialEq + Send + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait,

Get current value of state source.

Source

fn handle<'life0, 'async_trait, T>( &'life0 self, tag: Tag, ) -> Pin<Box<dyn Future<Output = Handle<T>> + Send + 'async_trait>>
where T: 'static + Clone + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait,

Get state handle.

Source

fn handle_value<'life0, 'async_trait, T>( &'life0 self, tag: Tag, ) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>
where T: 'static + Clone + PartialEq + Send + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait,

Get current value of state handle.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T, Tag> UseStateMachine<Tag> for T
where T: HasStateMachine<Tag>, Tag: 'static + Clone + Debug + Eq + Hash + Send + Sync,