pub trait ComposableIterator<T>: Iterator<Item = T> {
// Provided methods
fn pipe<F, R>(self, f: F) -> R
where Self: Sized,
F: FnOnce(Self) -> R { ... }
fn chain_keypath_ops(self) -> KeyPathsChain<T>
where Self: Sized { ... }
fn when_keypath<V, F, G, R>(
self,
keypath: KeyPaths<T, V>,
condition: F,
operation: G,
) -> KeyPathResult<Vec<R>>
where Self: Sized,
F: Fn(&V) -> bool,
G: FnOnce(IntoIter<T>) -> IntoIter<R> { ... }
fn unless_keypath<V, F, G, R>(
self,
keypath: KeyPaths<T, V>,
condition: F,
operation: G,
) -> KeyPathResult<Vec<R>>
where Self: Sized,
F: Fn(&V) -> bool,
G: FnOnce(IntoIter<T>) -> IntoIter<R> { ... }
}Expand description
Extension trait for adding composable operations to iterators
Provided Methods§
Sourcefn chain_keypath_ops(self) -> KeyPathsChain<T>where
Self: Sized,
fn chain_keypath_ops(self) -> KeyPathsChain<T>where
Self: Sized,
Chain keypath operations
Sourcefn when_keypath<V, F, G, R>(
self,
keypath: KeyPaths<T, V>,
condition: F,
operation: G,
) -> KeyPathResult<Vec<R>>
fn when_keypath<V, F, G, R>( self, keypath: KeyPaths<T, V>, condition: F, operation: G, ) -> KeyPathResult<Vec<R>>
Apply operation when condition is met