I am trying to iterate over either a set of function pointers which return objects which implement a trait. Or failing this, the objects themselves directly.
I have something like this:
Neither of which work because I cannot type the
Vec properly. I've tried a variety of different mechanisms, including
impl Trait at various points. But I cannot get this to work.
Any help gratefully received.
Edit: I want to iterate over the objects, calling objects on the trait, till I find one which "works" (matches a pattern in this case). I thought pointers to the constructors would work better so that I do not have to construct objects that I will not use all of.