I guess the visitor pattern is a nice placeholder for anonymous iterators until we get generators. First saw this in @KodrAus's kv log code. But now also using it for my own work!
pub fn visit(&self, visitor: &mut impl FnMut(&str));
Internally call visit for each item!
I've known about the visitor pattern for a while btw. It's just that I've never thought of them as a replacement for anon iterators. The other way around is true too: once anon iters land there's less need for visitors. Only if you need the fn to be executed in the caller contxt