Skip to main content

HasStateMachine

Trait HasStateMachine 

Source
pub trait HasStateMachine<Tag>
where Tag: Eq + Hash,
{ // Required methods fn lock<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = MutexGuard<'_, ()>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn state_machine<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StateMachine<Tag>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; }
Expand description

The trait defined basic methods to use state machine, usually you need a ‘Mutex<()>’ and a ‘StateMachine’ in your data structure.

Required Methods§

Source

fn lock<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = MutexGuard<'_, ()>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The mutex lock to use when responding state change.

Source

fn state_machine<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = StateMachine<Tag>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The state machine data structure.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§