GenAlgorithm

Trait GenAlgorithm 

Source
pub trait GenAlgorithm<CONTEXT, STATE, OUTPUT>: Generatable<OUTPUT> + Stateful<CONTEXT, STATE> {
    // Provided methods
    fn computation<COLLECTION: Default + Extend<OUTPUT> + 'static>(
        self,
    ) -> impl Computable<COLLECTION>
       where Self: Sized + 'static { ... }
    fn dyn_algorithm(self) -> DynGenAlgorithm<CONTEXT, STATE, OUTPUT>
       where Self: Sized + 'static { ... }
}
Expand description

Extends Generatable trait with immutable CONTEXT and mutable STATE.

Provided Methods§

Source

fn computation<COLLECTION: Default + Extend<OUTPUT> + 'static>( self, ) -> impl Computable<COLLECTION>
where Self: Sized + 'static,

Convert a GenAlgorithm into a Computable object that collects all values into a COLLECTION.

Source

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

Convert to a dynamic GenAlgorithm variant.

Implementors§

Source§

impl<CONTEXT, STATE, ITEM, STEP: GeneratorStep<CONTEXT, STATE, ITEM>> GenAlgorithm<CONTEXT, STATE, ITEM> for Generator<CONTEXT, STATE, ITEM, STEP>