I would like to implement a function like this
fn changed_ch_vals(&self) -> Map<Filter<Iter<'a, Channel>, fn(&Channel)->bool>, fn(&Channel)->ChVal> {
self.needs_update = false;
self.channels.iter()
.filter(Channel::is_changed())
.map(Channel::get_ch_val())
}
Something that borrows elements from a vector into an iterator, does some manipulation on it and passes the transformed iterator to someone else that does other operations.
It would be very easy if the adapters had also a version that takes a proper function instead of a closure because I can’t (or I don’t know how) use a closure in the type parameter.
So why it isn’t there? And how could I get it work?
Thank you in advance