pub trait IterBasic: IntoIterator + Sized {
// Provided methods
fn vfold<U, F>(self, init: U, f: F) -> U
where F: FnMut(U, Self::Item) -> U,
Self::Item: IsNone { ... }
fn vfold2<U, I2, F>(self, other: I2, init: U, f: F) -> U
where I2: IntoIterator,
I2::Item: IsNone,
F: FnMut(U, Self::Item, I2::Item) -> U,
Self::Item: IsNone { ... }
fn vfold_n<U, F>(self, init: U, f: F) -> (usize, U)
where F: FnMut(U, <Self::Item as IsNone>::Inner) -> U,
Self::Item: IsNone { ... }
fn vapply<F>(self, f: F)
where F: FnMut(<Self::Item as IsNone>::Inner),
Self::Item: IsNone { ... }
fn vapply_n<F>(self, f: F) -> usize
where F: FnMut(<Self::Item as IsNone>::Inner),
Self::Item: IsNone { ... }
}Expand description
A trait providing additional iterator methods for types that can be converted into an iterator.
Provided Methods§
sourcefn vfold2<U, I2, F>(self, other: I2, init: U, f: F) -> U
fn vfold2<U, I2, F>(self, other: I2, init: U, f: F) -> U
Folds two iterators together, skipping None values from either iterator.
§Arguments
other- The second iterator to fold with.init- The initial value for the fold operation.f- A closure that takes the accumulator and non-None items from both iterators, returning a new accumulator.
§Returns
The final accumulated value.
sourcefn vfold_n<U, F>(self, init: U, f: F) -> (usize, U)
fn vfold_n<U, F>(self, init: U, f: F) -> (usize, U)
Folds the elements of the iterator, skipping None values and counting non-None elements.
§Arguments
init- The initial value for the fold operation.f- A closure that takes the accumulator and the inner value of a non-None item, returning a new accumulator.
§Returns
A tuple containing the count of non-None elements and the final accumulated value.
sourcefn vapply<F>(self, f: F)
fn vapply<F>(self, f: F)
Applies a function to each non-None element of the iterator.
§Arguments
f- A closure that takes the inner value of a non-None item and performs some operation.
Object Safety§
This trait is not object safe.