AndWass / pushgen

Apache License 2.0
27 stars 4 forks source link

Reverse/DoubleEnded generators #47

Closed AndWass closed 3 years ago

AndWass commented 3 years ago

Initial suggestion to enable reverse generators:

Add

pub trait DoubleEndedGenerator: Generator {
    fn run_from_back(&mut self, output: impl FnMut(Self::Output) -> ValueResult) -> GeneratorResult;
}

This is implemented for SliceGenerator. Adaptors implement it based on if source-generator implements it.

This should allow for propogation of reverse-ness through the type-tree.

Questions