Skip to main content

Step

Trait Step 

Source
pub trait Step:
    AsAny
    + Send
    + Sync {
    // Required methods
    fn config_hash(&self) -> CacheKey;
    fn meta(&self) -> StepMeta;
    fn poll(&self, ctx: &StepCtx<'_>) -> Result<Transition>;
}
Expand description

An effectful node.

Implementors are registered in the runtime’s step library by node id, the same way filters are.

Required Methods§

Source

fn config_hash(&self) -> CacheKey

Hash of this step’s configuration. Same config, same hash — it is part of every journal key this step writes.

Source

fn meta(&self) -> StepMeta

This step’s StepMeta: turn budget, journaling, schemas, placement.

Source

fn poll(&self, ctx: &StepCtx<'_>) -> Result<Transition>

Advance one turn.

Called with ctx.turn == 0 and no results to start; thereafter with the results of whatever it last asked for. Must be deterministic given the same context and results — that is the whole basis of replay. Put the non-determinism in an Effect, where it gets recorded.

Implementors§