Skip to main content

TurnReducer

Trait TurnReducer 

Source
pub trait TurnReducer: Send + Sync {
    // Required method
    fn reduce(
        &self,
        input: &TurnInput,
        understanding: &Understanding,
        context: &ReductionContext,
    ) -> Result<ReductionPlan, ReductionError>;
}
Expand description

The pure whole-turn reducer (spec §13).

Required Methods§

Source

fn reduce( &self, input: &TurnInput, understanding: &Understanding, context: &ReductionContext, ) -> Result<ReductionPlan, ReductionError>

Reduces one understood turn into an execution plan. Must be deterministic for the same inputs and must not perform I/O.

§Errors

A ReductionError for an understanding over the limits or a plan that fails its own consistency checks.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§