Trait pushgen::traits::DynGenerator [−][src]
pub trait DynGenerator: Sealed { type Output; fn run_dyn(
&mut self,
output: &mut dyn FnMut(Self::Output) -> ValueResult
) -> GeneratorResult; }
Expand description
Sealed trait to enable boxed generators. See .boxed()
for details.
This trait should normally not be used. Pretty much the only use-case for this is to be an object-safe trait, thus allowing for dynamic trait objects and boxing.
This trait is blanked implemented for all generators.
Associated Types
Required methods
fn run_dyn(
&mut self,
output: &mut dyn FnMut(Self::Output) -> ValueResult
) -> GeneratorResult
fn run_dyn(
&mut self,
output: &mut dyn FnMut(Self::Output) -> ValueResult
) -> GeneratorResult
Run the generator using a &mut dyn FnMut
instead of impl FnMut
. This