Algorithm

Trait Algorithm 

Source
pub trait Algorithm<CONTEXT, STATE, OUTPUT>: Computable<OUTPUT> + Stateful<CONTEXT, STATE> {
    // Provided methods
    fn run<I1: Into<CONTEXT>, I2: Into<STATE>>(
        context: I1,
        initial_state: I2,
    ) -> Cancellable<OUTPUT>
       where Self: Sized + 'static { ... }
    fn dyn_algorithm(self) -> DynAlgorithm<CONTEXT, STATE, OUTPUT>
       where Self: Sized + 'static { ... }
}
Expand description

Extends Computable trait with immutable CONTEXT and mutable STATE.

Provided Methods§

Source

fn run<I1: Into<CONTEXT>, I2: Into<STATE>>( context: I1, initial_state: I2, ) -> Cancellable<OUTPUT>
where Self: Sized + 'static,

Configure and immediately execute the computation, skipping over all suspended states.

Source

fn dyn_algorithm(self) -> DynAlgorithm<CONTEXT, STATE, OUTPUT>
where Self: Sized + 'static,

Convert to a dynamic Algorithm variant.

Implementors§

Source§

impl<CONTEXT, STATE, OUTPUT, STEP: ComputationStep<CONTEXT, STATE, OUTPUT>> Algorithm<CONTEXT, STATE, OUTPUT> for Computation<CONTEXT, STATE, OUTPUT, STEP>