Skip to main content

State

Trait State 

Source
pub trait State: Send + Sync {
    // Required methods
    fn meta(&self) -> StateMeta;
    fn handle<'life0, 'life1, 'life2, 'life3, 'async_trait>(
        &'life0 self,
        ctx: &'life1 mut dyn DynContext,
        io: &'life2 mut dyn IoProvider,
        rec: &'life3 mut dyn EventRecorder,
    ) -> Pin<Box<dyn Future<Output = Result<StateOutcome, StateError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait,
             'life3: 'async_trait;
}
Expand description

Note:

  • The engine MAY still checkpoint context according to RunConfig.context_checkpointing regardless of StateOutcome.snapshot. This hint controls additional snapshot behavior and/or diagnostic snapshots, not permission to bypass required checkpoints. State behavior. States do NOT own their StateId — IDs are assigned by the plan.

Required Methods§

Source

fn meta(&self) -> StateMeta

Returns metadata used for planning, replay, and policy decisions.

Source

fn handle<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, ctx: &'life1 mut dyn DynContext, io: &'life2 mut dyn IoProvider, rec: &'life3 mut dyn EventRecorder, ) -> Pin<Box<dyn Future<Output = Result<StateOutcome, StateError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Executes the state against the provided context, IO provider, and event recorder.

Implementors§