Something conceptually like this:
pub struct S<F> {
f: F
}
impl<F, I, O> Iterator for S<F>
where
F: FnOnce(I),
<F as FnOnce(I,)>::Output: IntoIterator<Item=O>
{
type Item = O;
fn next(&mut self) -> OptionSelf::Item {
unimplemented!()
}
}
https://doc.rust-lang.org/std/ops/trait.FnOnce.html
FnOnce is just a trait, and its associated type is "Output". The Args are just type parameters. I'm struggling to put bounds on this FnOnce without getting error messages though, can someone show me the right way to put trait bounds on the associated type for a FnOnce?
The version of the call operator that takes a by-value receiver.