Closed epage closed 3 years ago
Hmm tricky one!
I have an idea that involves adding another DynGenerator
trait which is object safe with blanket implementation for Generator
. Shouldn't you then be able to box a dyn DynGenerator
? I'll do some testing!
What do you think of the approach taken in #37?
Looks good to me
I think the
impl
argument for run makes it soGenerator
is not object-safe and therefore can't be boxedWhile in most cases, boxing isn't needed, for a trait to return a
Generator
, it needs to be boxed to allow the trait impls to create whateverGenerator
they need.