Trait ChildMachine

Source
pub trait ChildMachine: Send + Sync {
    // Required methods
    fn send_event<'life0, 'async_trait>(
        &'life0 mut self,
        event: Event,
    ) -> Pin<Box<dyn Future<Output = Result<bool, StateError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_status<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = IntegrationResult<Option<String>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn is_in_final_state(&self) -> bool;
    fn is_in_state<'life0, 'life1, 'async_trait>(
        &'life0 self,
        state_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<bool, StateError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn current_states(&self) -> Vec<String>;
    fn to_json(&self) -> IntegrationResult<String>;
}
Expand description

子ステートマシンのインターフェース

このトレイトは親ステートマシンから子ステートマシンへの 操作を抽象化するために使用されます。

Required Methods§

Source

fn send_event<'life0, 'async_trait>( &'life0 mut self, event: Event, ) -> Pin<Box<dyn Future<Output = Result<bool, StateError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

子ステートマシンにイベントを送信します。

§引数
  • event - 子ステートマシンに送信するイベント。
§戻り値
  • イベントが処理された場合は Ok(true)、処理されなかった場合は Ok(false)
  • エラーが発生した場合は Err
Source

fn get_status<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = IntegrationResult<Option<String>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

子ステートマシンの現在の状態(またはステータス)を取得します。

§戻り値
  • 現在の状態を表す文字列の Option
  • エラーが発生した場合は Err
Source

fn is_in_final_state(&self) -> bool

最終状態にあるか確認

Source

fn is_in_state<'life0, 'life1, 'async_trait>( &'life0 self, state_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<bool, StateError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

特定の状態にあるか確認

Source

fn current_states(&self) -> Vec<String>

現在の状態IDのリストを取得

Source

fn to_json(&self) -> IntegrationResult<String>

子ステートマシンのJSON表現を取得

Implementors§