Skip to main content

UseStateSource

Trait UseStateSource 

Source
pub trait UseStateSource<G>: HasStateMachine<G>
where G: 'static + Clone + Debug + Eq + Hash + Send + Sync,
{ // Provided methods fn add_source<'life0, 'async_trait, S>( &'life0 self, tag: G, ) -> Pin<Box<dyn Future<Output = Source<S>> + Send + 'async_trait>> where S: 'static + Clone + Default + PartialEq + Send + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait { ... } fn add_source_ex<'life0, 'async_trait, S>( &'life0 self, tag: G, source: Source<S>, ) -> Pin<Box<dyn Future<Output = Source<S>> + Send + 'async_trait>> where S: 'static + Clone + Send + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait { ... } }
Expand description

Convenient method to add state source to state machine. The trait is auto implemented for types implemented HasStateMachine.

Provided Methods§

Source

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

Add state source to state machine, the state source is created by default.

Source

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

Add state source to state machine.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§

Source§

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