pub trait Iterator {
type Item;
Show 76 methods
// Required method
fn next(&mut self) -> Option<Self::Item>;
// Provided methods
fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>
where Self: Sized { ... }
fn size_hint(&self) -> (usize, Option<usize>) { ... }
fn count(self) -> usize
where Self: Sized { ... }
fn last(self) -> Option<Self::Item>
where Self: Sized { ... }
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>> { ... }
fn nth(&mut self, n: usize) -> Option<Self::Item> { ... }
fn step_by(self, step: usize) -> StepBy<Self> ⓘ
where Self: Sized { ... }
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter> ⓘ
where Self: Sized,
U: IntoIterator<Item = Self::Item> { ... }
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter> ⓘ
where Self: Sized,
U: IntoIterator { ... }
fn intersperse(self, separator: Self::Item) -> Intersperse<Self> ⓘ
where Self: Sized,
Self::Item: Clone { ... }
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> ⓘ
where Self: Sized,
G: FnMut() -> Self::Item { ... }
fn map<B, F>(self, f: F) -> Map<Self, F> ⓘ
where Self: Sized,
F: FnMut(Self::Item) -> B { ... }
fn for_each<F>(self, f: F)
where Self: Sized,
F: FnMut(Self::Item) { ... }
fn filter<P>(self, predicate: P) -> Filter<Self, P> ⓘ
where Self: Sized,
P: FnMut(&Self::Item) -> bool { ... }
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> ⓘ
where Self: Sized,
F: FnMut(Self::Item) -> Option<B> { ... }
fn enumerate(self) -> Enumerate<Self> ⓘ
where Self: Sized { ... }
fn peekable(self) -> Peekable<Self> ⓘ
where Self: Sized { ... }
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> ⓘ
where Self: Sized,
P: FnMut(&Self::Item) -> bool { ... }
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> ⓘ
where Self: Sized,
P: FnMut(&Self::Item) -> bool { ... }
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> ⓘ
where Self: Sized,
P: FnMut(Self::Item) -> Option<B> { ... }
fn skip(self, n: usize) -> Skip<Self> ⓘ
where Self: Sized { ... }
fn take(self, n: usize) -> Take<Self> ⓘ
where Self: Sized { ... }
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> ⓘ
where Self: Sized,
F: FnMut(&mut St, Self::Item) -> Option<B> { ... }
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> ⓘ
where Self: Sized,
U: IntoIterator,
F: FnMut(Self::Item) -> U { ... }
fn flatten(self) -> Flatten<Self> ⓘ
where Self: Sized,
Self::Item: IntoIterator { ... }
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N> ⓘ
where Self: Sized,
F: FnMut(&[Self::Item; N]) -> R { ... }
fn fuse(self) -> Fuse<Self> ⓘ
where Self: Sized { ... }
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
where Self: Sized,
F: FnMut(&Self::Item) { ... }
fn by_ref(&mut self) -> &mut Self
where Self: Sized { ... }
fn collect<B>(self) -> B
where B: FromIterator<Self::Item>,
Self: Sized { ... }
fn try_collect<B>(
&mut self,
) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
where Self: Sized,
Self::Item: Try,
<Self::Item as Try>::Residual: Residual<B>,
B: FromIterator<<Self::Item as Try>::Output> { ... }
fn collect_into<E>(self, collection: &mut E) -> &mut E
where E: Extend<Self::Item>,
Self: Sized { ... }
fn partition<B, F>(self, f: F) -> (B, B)
where Self: Sized,
B: Default + Extend<Self::Item>,
F: FnMut(&Self::Item) -> bool { ... }
fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
where T: 'a,
Self: Sized + DoubleEndedIterator<Item = &'a mut T>,
P: FnMut(&T) -> bool { ... }
fn is_partitioned<P>(self, predicate: P) -> bool
where Self: Sized,
P: FnMut(Self::Item) -> bool { ... }
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
where Self: Sized,
F: FnMut(B, Self::Item) -> R,
R: Try<Output = B> { ... }
fn try_for_each<F, R>(&mut self, f: F) -> R
where Self: Sized,
F: FnMut(Self::Item) -> R,
R: Try<Output = ()> { ... }
fn fold<B, F>(self, init: B, f: F) -> B
where Self: Sized,
F: FnMut(B, Self::Item) -> B { ... }
fn reduce<F>(self, f: F) -> Option<Self::Item>
where Self: Sized,
F: FnMut(Self::Item, Self::Item) -> Self::Item { ... }
fn try_reduce<R>(
&mut self,
f: impl FnMut(Self::Item, Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
where Self: Sized,
R: Try<Output = Self::Item>,
<R as Try>::Residual: Residual<Option<Self::Item>> { ... }
fn all<F>(&mut self, f: F) -> bool
where Self: Sized,
F: FnMut(Self::Item) -> bool { ... }
fn any<F>(&mut self, f: F) -> bool
where Self: Sized,
F: FnMut(Self::Item) -> bool { ... }
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
where Self: Sized,
P: FnMut(&Self::Item) -> bool { ... }
fn find_map<B, F>(&mut self, f: F) -> Option<B>
where Self: Sized,
F: FnMut(Self::Item) -> Option<B> { ... }
fn try_find<R>(
&mut self,
f: impl FnMut(&Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
where Self: Sized,
R: Try<Output = bool>,
<R as Try>::Residual: Residual<Option<Self::Item>> { ... }
fn position<P>(&mut self, predicate: P) -> Option<usize>
where Self: Sized,
P: FnMut(Self::Item) -> bool { ... }
fn rposition<P>(&mut self, predicate: P) -> Option<usize>
where P: FnMut(Self::Item) -> bool,
Self: Sized + ExactSizeIterator + DoubleEndedIterator { ... }
fn max(self) -> Option<Self::Item>
where Self: Sized,
Self::Item: Ord { ... }
fn min(self) -> Option<Self::Item>
where Self: Sized,
Self::Item: Ord { ... }
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
where B: Ord,
Self: Sized,
F: FnMut(&Self::Item) -> B { ... }
fn max_by<F>(self, compare: F) -> Option<Self::Item>
where Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering { ... }
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
where B: Ord,
Self: Sized,
F: FnMut(&Self::Item) -> B { ... }
fn min_by<F>(self, compare: F) -> Option<Self::Item>
where Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> Ordering { ... }
fn rev(self) -> Rev<Self> ⓘ
where Self: Sized + DoubleEndedIterator { ... }
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
where FromA: Default + Extend<A>,
FromB: Default + Extend<B>,
Self: Sized + Iterator<Item = (A, B)> { ... }
fn copied<'a, T>(self) -> Copied<Self> ⓘ
where T: Copy + 'a,
Self: Sized + Iterator<Item = &'a T> { ... }
fn cloned<'a, T>(self) -> Cloned<Self> ⓘ
where T: Clone + 'a,
Self: Sized + Iterator<Item = &'a T> { ... }
fn cycle(self) -> Cycle<Self> ⓘ
where Self: Sized + Clone { ... }
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N> ⓘ
where Self: Sized { ... }
fn sum<S>(self) -> S
where Self: Sized,
S: Sum<Self::Item> { ... }
fn product<P>(self) -> P
where Self: Sized,
P: Product<Self::Item> { ... }
fn cmp<I>(self, other: I) -> Ordering
where I: IntoIterator<Item = Self::Item>,
Self::Item: Ord,
Self: Sized { ... }
fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
where Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Ordering { ... }
fn partial_cmp<I>(self, other: I) -> Option<Ordering>
where I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized { ... }
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>
where Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering> { ... }
fn eq<I>(self, other: I) -> bool
where I: IntoIterator,
Self::Item: PartialEq<<I as IntoIterator>::Item>,
Self: Sized { ... }
fn eq_by<I, F>(self, other: I, eq: F) -> bool
where Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> bool { ... }
fn ne<I>(self, other: I) -> bool
where I: IntoIterator,
Self::Item: PartialEq<<I as IntoIterator>::Item>,
Self: Sized { ... }
fn lt<I>(self, other: I) -> bool
where I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized { ... }
fn le<I>(self, other: I) -> bool
where I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized { ... }
fn gt<I>(self, other: I) -> bool
where I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized { ... }
fn ge<I>(self, other: I) -> bool
where I: IntoIterator,
Self::Item: PartialOrd<<I as IntoIterator>::Item>,
Self: Sized { ... }
fn is_sorted(self) -> bool
where Self: Sized,
Self::Item: PartialOrd { ... }
fn is_sorted_by<F>(self, compare: F) -> bool
where Self: Sized,
F: FnMut(&Self::Item, &Self::Item) -> bool { ... }
fn is_sorted_by_key<F, K>(self, f: F) -> bool
where Self: Sized,
F: FnMut(Self::Item) -> K,
K: PartialOrd { ... }
}Expand description
A trait for dealing with iterators.
This is the main iterator trait. For more about the concept of iterators
generally, please see the module-level documentation. In particular, you
may want to know how to implement Iterator.
Required Associated Types§
Required Methods§
1.0.0 (const: unstable) · Sourcefn next(&mut self) -> Option<Self::Item>
fn next(&mut self) -> Option<Self::Item>
Advances the iterator and returns the next value.
Returns None when iteration is finished. Individual iterator
implementations may choose to resume iteration, and so calling next()
again may or may not eventually start returning Some(Item) again at some
point.
§Examples
let a = [1, 2, 3];
let mut iter = a.into_iter();
// A call to next() returns the next value...
assert_eq!(Some(1), iter.next());
assert_eq!(Some(2), iter.next());
assert_eq!(Some(3), iter.next());
// ... and then None once it's over.
assert_eq!(None, iter.next());
// More calls may or may not return `None`. Here, they always will.
assert_eq!(None, iter.next());
assert_eq!(None, iter.next());Provided Methods§
Sourcefn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
🔬This is a nightly-only experimental API. (iter_next_chunk)
fn next_chunk<const N: usize>(
&mut self,
) -> Result<[Self::Item; N], IntoIter<Self::Item, N>>where
Self: Sized,
iter_next_chunk)Advances the iterator and returns an array containing the next N values.
If there are not enough elements to fill the array then Err is returned
containing an iterator over the remaining elements.
§Examples
Basic usage:
#![feature(iter_next_chunk)]
let mut iter = "lorem".chars();
assert_eq!(iter.next_chunk().unwrap(), ['l', 'o']); // N is inferred as 2
assert_eq!(iter.next_chunk().unwrap(), ['r', 'e', 'm']); // N is inferred as 3
assert_eq!(iter.next_chunk::<4>().unwrap_err().as_slice(), &[]); // N is explicitly 4Split a string and get the first three items.
#![feature(iter_next_chunk)]
let quote = "not all those who wander are lost";
let [first, second, third] = quote.split_whitespace().next_chunk().unwrap();
assert_eq!(first, "not");
assert_eq!(second, "all");
assert_eq!(third, "those");1.0.0 (const: unstable) · Sourcefn size_hint(&self) -> (usize, Option<usize>)
fn size_hint(&self) -> (usize, Option<usize>)
Returns the bounds on the remaining length of the iterator.
Specifically, size_hint() returns a tuple where the first element
is the lower bound, and the second element is the upper bound.
The second half of the tuple that is returned is an Option<usize>.
A None here means that either there is no known upper bound, or the
upper bound is larger than usize.
§Implementation notes
It is not enforced that an iterator implementation yields the declared number of elements. A buggy iterator may yield less than the lower bound or more than the upper bound of elements.
size_hint() is primarily intended to be used for optimizations such as
reserving space for the elements of the iterator, but must not be
trusted to e.g., omit bounds checks in unsafe code. An incorrect
implementation of size_hint() should not lead to memory safety
violations.
That said, the implementation should provide a correct estimation, because otherwise it would be a violation of the trait’s protocol.
The default implementation returns (0, None) which is correct for any
iterator.
§Examples
Basic usage:
let a = [1, 2, 3];
let mut iter = a.iter();
assert_eq!((3, Some(3)), iter.size_hint());
let _ = iter.next();
assert_eq!((2, Some(2)), iter.size_hint());A more complex example:
// The even numbers in the range of zero to nine.
let iter = (0..10).filter(|x| x % 2 == 0);
// We might iterate from zero to ten times. Knowing that it's five
// exactly wouldn't be possible without executing filter().
assert_eq!((0, Some(10)), iter.size_hint());
// Let's add five more numbers with chain()
let iter = (0..10).filter(|x| x % 2 == 0).chain(15..20);
// now both bounds are increased by five
assert_eq!((5, Some(15)), iter.size_hint());Returning None for an upper bound:
// an infinite iterator has no upper bound
// and the maximum possible lower bound
let iter = 0..;
assert_eq!((usize::MAX, None), iter.size_hint());1.0.0 (const: unstable) · Sourcefn count(self) -> usizewhere
Self: Sized,
fn count(self) -> usizewhere
Self: Sized,
Consumes the iterator, counting the number of iterations and returning it.
This method will call next repeatedly until None is encountered,
returning the number of times it saw Some. Note that next has to be
called at least once even if the iterator does not have any elements.
§Overflow Behavior
The method does no guarding against overflows, so counting elements of
an iterator with more than usize::MAX elements either produces the
wrong result or panics. If overflow checks are enabled, a panic is
guaranteed.
§Panics
This function might panic if the iterator has more than usize::MAX
elements.
§Examples
let a = [1, 2, 3];
assert_eq!(a.iter().count(), 3);
let a = [1, 2, 3, 4, 5];
assert_eq!(a.iter().count(), 5);1.0.0 (const: unstable) · Sourcefn last(self) -> Option<Self::Item>where
Self: Sized,
fn last(self) -> Option<Self::Item>where
Self: Sized,
Consumes the iterator, returning the last element.
This method will evaluate the iterator until it returns None. While
doing so, it keeps track of the current element. After None is
returned, last() will then return the last element it saw.
§Panics
This function might panic if the iterator is infinite.
§Examples
let a = [1, 2, 3];
assert_eq!(a.into_iter().last(), Some(3));
let a = [1, 2, 3, 4, 5];
assert_eq!(a.into_iter().last(), Some(5));Sourcefn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
🔬This is a nightly-only experimental API. (iter_advance_by)
fn advance_by(&mut self, n: usize) -> Result<(), NonZero<usize>>
iter_advance_by)Advances the iterator by n elements.
This method will eagerly skip n elements by calling next up to n
times until None is encountered.
advance_by(n) will return Ok(()) if the iterator successfully advances by
n elements, or a Err(NonZero<usize>) with value k if None is encountered,
where k is remaining number of steps that could not be advanced because the iterator ran out.
If self is empty and n is non-zero, then this returns Err(n).
Otherwise, k is always less than n.
Calling advance_by(0) can do meaningful work, for example Flatten
can advance its outer iterator until it finds an inner iterator that is not empty, which
then often allows it to return a more accurate size_hint() than in its initial state.
§Examples
#![feature(iter_advance_by)]
use std::num::NonZero;
let a = [1, 2, 3, 4];
let mut iter = a.into_iter();
assert_eq!(iter.advance_by(2), Ok(()));
assert_eq!(iter.next(), Some(3));
assert_eq!(iter.advance_by(0), Ok(()));
assert_eq!(iter.advance_by(100), Err(NonZero::new(99).unwrap())); // only `4` was skipped1.0.0 (const: unstable) · Sourcefn nth(&mut self, n: usize) -> Option<Self::Item>
fn nth(&mut self, n: usize) -> Option<Self::Item>
Returns the nth element of the iterator.
Like most indexing operations, the count starts from zero, so nth(0)
returns the first value, nth(1) the second, and so on.
Note that all preceding elements, as well as the returned element, will be
consumed from the iterator. That means that the preceding elements will be
discarded, and also that calling nth(0) multiple times on the same iterator
will return different elements.
nth() will return None if n is greater than or equal to the length of the
iterator.
§Examples
Basic usage:
let a = [1, 2, 3];
assert_eq!(a.into_iter().nth(1), Some(2));Calling nth() multiple times doesn’t rewind the iterator:
let a = [1, 2, 3];
let mut iter = a.into_iter();
assert_eq!(iter.nth(1), Some(2));
assert_eq!(iter.nth(1), None);Returning None if there are less than n + 1 elements:
let a = [1, 2, 3];
assert_eq!(a.into_iter().nth(10), None);1.28.0 (const: unstable) · Sourcefn step_by(self, step: usize) -> StepBy<Self> ⓘwhere
Self: Sized,
fn step_by(self, step: usize) -> StepBy<Self> ⓘwhere
Self: Sized,
Creates an iterator starting at the same point, but stepping by the given amount at each iteration.
Note 1: The first element of the iterator will always be returned, regardless of the step given.
Note 2: The time at which ignored elements are pulled is not fixed.
StepBy behaves like the sequence self.next(), self.nth(step-1),
self.nth(step-1), …, but is also free to behave like the sequence
advance_n_and_return_first(&mut self, step),
advance_n_and_return_first(&mut self, step), …
Which way is used may change for some iterators for performance reasons.
The second way will advance the iterator earlier and may consume more items.
advance_n_and_return_first is the equivalent of:
fn advance_n_and_return_first<I>(iter: &mut I, n: usize) -> Option<I::Item>
where
I: Iterator,
{
let next = iter.next();
if n > 1 {
iter.nth(n - 2);
}
next
}§Panics
The method will panic if the given step is 0.
§Examples
let a = [0, 1, 2, 3, 4, 5];
let mut iter = a.into_iter().step_by(2);
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), None);1.0.0 (const: unstable) · Sourcefn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter> ⓘ
fn chain<U>(self, other: U) -> Chain<Self, <U as IntoIterator>::IntoIter> ⓘ
Takes two iterators and creates a new iterator over both in sequence.
chain() will return a new iterator which will first iterate over
values from the first iterator and then over values from the second
iterator.
In other words, it links two iterators together, in a chain. 🔗
once is commonly used to adapt a single value into a chain of
other kinds of iteration.
§Examples
Basic usage:
let s1 = "abc".chars();
let s2 = "def".chars();
let mut iter = s1.chain(s2);
assert_eq!(iter.next(), Some('a'));
assert_eq!(iter.next(), Some('b'));
assert_eq!(iter.next(), Some('c'));
assert_eq!(iter.next(), Some('d'));
assert_eq!(iter.next(), Some('e'));
assert_eq!(iter.next(), Some('f'));
assert_eq!(iter.next(), None);Since the argument to chain() uses IntoIterator, we can pass
anything that can be converted into an Iterator, not just an
Iterator itself. For example, arrays ([T]) implement
IntoIterator, and so can be passed to chain() directly:
let a1 = [1, 2, 3];
let a2 = [4, 5, 6];
let mut iter = a1.into_iter().chain(a2);
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), Some(3));
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), Some(5));
assert_eq!(iter.next(), Some(6));
assert_eq!(iter.next(), None);If you work with Windows API, you may wish to convert OsStr to Vec<u16>:
#[cfg(windows)]
fn os_str_to_utf16(s: &std::ffi::OsStr) -> Vec<u16> {
use std::os::windows::ffi::OsStrExt;
s.encode_wide().chain(std::iter::once(0)).collect()
}1.0.0 (const: unstable) · Sourcefn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter> ⓘwhere
Self: Sized,
U: IntoIterator,
fn zip<U>(self, other: U) -> Zip<Self, <U as IntoIterator>::IntoIter> ⓘwhere
Self: Sized,
U: IntoIterator,
‘Zips up’ two iterators into a single iterator of pairs.
zip() returns a new iterator that will iterate over two other
iterators, returning a tuple where the first element comes from the
first iterator, and the second element comes from the second iterator.
In other words, it zips two iterators together, into a single one.
If either iterator returns None, next from the zipped iterator
will return None.
If the zipped iterator has no more elements to return then each further attempt to advance
it will first try to advance the first iterator at most one time and if it still yielded an item
try to advance the second iterator at most one time.
To ‘undo’ the result of zipping up two iterators, see unzip.
§Examples
Basic usage:
let s1 = "abc".chars();
let s2 = "def".chars();
let mut iter = s1.zip(s2);
assert_eq!(iter.next(), Some(('a', 'd')));
assert_eq!(iter.next(), Some(('b', 'e')));
assert_eq!(iter.next(), Some(('c', 'f')));
assert_eq!(iter.next(), None);Since the argument to zip() uses IntoIterator, we can pass
anything that can be converted into an Iterator, not just an
Iterator itself. For example, arrays ([T]) implement
IntoIterator, and so can be passed to zip() directly:
let a1 = [1, 2, 3];
let a2 = [4, 5, 6];
let mut iter = a1.into_iter().zip(a2);
assert_eq!(iter.next(), Some((1, 4)));
assert_eq!(iter.next(), Some((2, 5)));
assert_eq!(iter.next(), Some((3, 6)));
assert_eq!(iter.next(), None);zip() is often used to zip an infinite iterator to a finite one.
This works because the finite iterator will eventually return None,
ending the zipper. Zipping with (0..) can look a lot like enumerate:
let enumerate: Vec<_> = "foo".chars().enumerate().collect();
let zipper: Vec<_> = (0..).zip("foo".chars()).collect();
assert_eq!((0, 'f'), enumerate[0]);
assert_eq!((0, 'f'), zipper[0]);
assert_eq!((1, 'o'), enumerate[1]);
assert_eq!((1, 'o'), zipper[1]);
assert_eq!((2, 'o'), enumerate[2]);
assert_eq!((2, 'o'), zipper[2]);If both iterators have roughly equivalent syntax, it may be more readable to use zip:
use std::iter::zip;
let a = [1, 2, 3];
let b = [2, 3, 4];
let mut zipped = zip(
a.into_iter().map(|x| x * 2).skip(1),
b.into_iter().map(|x| x * 2).skip(1),
);
assert_eq!(zipped.next(), Some((4, 6)));
assert_eq!(zipped.next(), Some((6, 8)));
assert_eq!(zipped.next(), None);compared to:
let mut zipped = a
.into_iter()
.map(|x| x * 2)
.skip(1)
.zip(b.into_iter().map(|x| x * 2).skip(1));Sourcefn intersperse(self, separator: Self::Item) -> Intersperse<Self> ⓘ
🔬This is a nightly-only experimental API. (iter_intersperse)
fn intersperse(self, separator: Self::Item) -> Intersperse<Self> ⓘ
iter_intersperse)Creates a new iterator which places a copy of separator between items
of the original iterator.
Specifically on fused iterators, it is guaranteed that the new iterator
places a copy of separator between adjacent Some(_) items. For non-fused iterators,
it is guaranteed that intersperse will create a new iterator that places a copy
of separator between Some(_) items, particularly just right before the subsequent
Some(_) item.
For example, consider the following non-fused iterator:
Some(1) -> Some(2) -> None -> Some(3) -> Some(4) -> ...If this non-fused iterator were to be interspersed with 0,
then the interspersed iterator will produce:
Some(1) -> Some(0) -> Some(2) -> None -> Some(0) -> Some(3) -> Some(0) ->
Some(4) -> ...In case separator does not implement Clone or needs to be
computed every time, use intersperse_with.
§Examples
Basic usage:
#![feature(iter_intersperse)]
let mut a = [0, 1, 2].into_iter().intersperse(100);
assert_eq!(a.next(), Some(0)); // The first element from `a`.
assert_eq!(a.next(), Some(100)); // The separator.
assert_eq!(a.next(), Some(1)); // The next element from `a`.
assert_eq!(a.next(), Some(100)); // The separator.
assert_eq!(a.next(), Some(2)); // The last element from `a`.
assert_eq!(a.next(), None); // The iterator is finished.intersperse can be very useful to join an iterator’s items using a common element:
#![feature(iter_intersperse)]
let words = ["Hello", "World", "!"];
let hello: String = words.into_iter().intersperse(" ").collect();
assert_eq!(hello, "Hello World !");Sourcefn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> ⓘ
🔬This is a nightly-only experimental API. (iter_intersperse)
fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> ⓘ
iter_intersperse)Creates a new iterator which places an item generated by separator
between items of the original iterator.
Specifically on fused iterators, it is guaranteed that the new iterator
places an item generated by separator between adjacent Some(_) items.
For non-fused iterators, it is guaranteed that intersperse_with will
create a new iterator that places an item generated by separator between Some(_)
items, particularly just right before the subsequent Some(_) item.
For example, consider the following non-fused iterator:
Some(1) -> Some(2) -> None -> Some(3) -> Some(4) -> ...If this non-fused iterator were to be interspersed with a separator closure
that returns 0 repeatedly, the interspersed iterator will produce:
Some(1) -> Some(0) -> Some(2) -> None -> Some(0) -> Some(3) -> Some(0) ->
Some(4) -> ...The separator closure will be called exactly once each time an item
is placed between two adjacent items from the underlying iterator;
specifically, the closure is not called if the underlying iterator yields
less than two items and after the last item is yielded.
If the iterator’s item implements Clone, it may be easier to use
intersperse.
§Examples
Basic usage:
#![feature(iter_intersperse)]
#[derive(PartialEq, Debug)]
struct NotClone(usize);
let v = [NotClone(0), NotClone(1), NotClone(2)];
let mut it = v.into_iter().intersperse_with(|| NotClone(99));
assert_eq!(it.next(), Some(NotClone(0))); // The first element from `v`.
assert_eq!(it.next(), Some(NotClone(99))); // The separator.
assert_eq!(it.next(), Some(NotClone(1))); // The next element from `v`.
assert_eq!(it.next(), Some(NotClone(99))); // The separator.
assert_eq!(it.next(), Some(NotClone(2))); // The last element from `v`.
assert_eq!(it.next(), None); // The iterator is finished.intersperse_with can be used in situations where the separator needs
to be computed:
#![feature(iter_intersperse)]
let src = ["Hello", "to", "all", "people", "!!"].iter().copied();
// The closure mutably borrows its context to generate an item.
let mut happy_emojis = [" ❤️ ", " 😀 "].into_iter();
let separator = || happy_emojis.next().unwrap_or(" 🦀 ");
let result = src.intersperse_with(separator).collect::<String>();
assert_eq!(result, "Hello ❤️ to 😀 all 🦀 people 🦀 !!");1.0.0 (const: unstable) · Sourcefn map<B, F>(self, f: F) -> Map<Self, F> ⓘ
fn map<B, F>(self, f: F) -> Map<Self, F> ⓘ
Takes a closure and creates an iterator which calls that closure on each element.
map() transforms one iterator into another, by means of its argument:
something that implements FnMut. It produces a new iterator which
calls this closure on each element of the original iterator.
If you are good at thinking in types, you can think of map() like this:
If you have an iterator that gives you elements of some type A, and
you want an iterator of some other type B, you can use map(),
passing a closure that takes an A and returns a B.
map() is conceptually similar to a for loop. However, as map() is
lazy, it is best used when you’re already working with other iterators.
If you’re doing some sort of looping for a side effect, it’s considered
more idiomatic to use for than map().
§Examples
Basic usage:
let a = [1, 2, 3];
let mut iter = a.iter().map(|x| 2 * x);
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), Some(6));
assert_eq!(iter.next(), None);If you’re doing some sort of side effect, prefer for to map():
// don't do this:
(0..5).map(|x| println!("{x}"));
// it won't even execute, as it is lazy. Rust will warn you about this.
// Instead, use a for-loop:
for x in 0..5 {
println!("{x}");
}1.21.0 (const: unstable) · Sourcefn for_each<F>(self, f: F)
fn for_each<F>(self, f: F)
Calls a closure on each element of an iterator.
This is equivalent to using a for loop on the iterator, although
break and continue are not possible from a closure. It’s generally
more idiomatic to use a for loop, but for_each may be more legible
when processing items at the end of longer iterator chains. In some
cases for_each may also be faster than a loop, because it will use
internal iteration on adapters like Chain.
§Examples
Basic usage:
use std::sync::mpsc::channel;
let (tx, rx) = channel();
(0..5).map(|x| x * 2 + 1)
.for_each(move |x| tx.send(x).unwrap());
let v: Vec<_> = rx.iter().collect();
assert_eq!(v, vec![1, 3, 5, 7, 9]);For such a small example, a for loop may be cleaner, but for_each
might be preferable to keep a functional style with longer iterators:
(0..5).flat_map(|x| (x * 100)..(x * 110))
.enumerate()
.filter(|&(i, x)| (i + x) % 3 == 0)
.for_each(|(i, x)| println!("{i}:{x}"));1.0.0 (const: unstable) · Sourcefn filter<P>(self, predicate: P) -> Filter<Self, P> ⓘ
fn filter<P>(self, predicate: P) -> Filter<Self, P> ⓘ
Creates an iterator which uses a closure to determine if an element should be yielded.
Given an element the closure must return true or false. The returned
iterator will yield only the elements for which the closure returns
true.
§Examples
Basic usage:
let a = [0i32, 1, 2];
let mut iter = a.into_iter().filter(|x| x.is_positive());
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), None);Because the closure passed to filter() takes a reference, and many
iterators iterate over references, this leads to a possibly confusing
situation, where the type of the closure is a double reference:
let s = &[0, 1, 2];
let mut iter = s.iter().filter(|x| **x > 1); // needs two *s!
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), None);It’s common to instead use destructuring on the argument to strip away one:
let s = &[0, 1, 2];
let mut iter = s.iter().filter(|&x| *x > 1); // both & and *
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), None);or both:
let s = &[0, 1, 2];
let mut iter = s.iter().filter(|&&x| x > 1); // two &s
assert_eq!(iter.next(), Some(&2));
assert_eq!(iter.next(), None);of these layers.
Note that iter.filter(f).next() is equivalent to iter.find(f).
1.0.0 (const: unstable) · Sourcefn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> ⓘ
fn filter_map<B, F>(self, f: F) -> FilterMap<Self, F> ⓘ
Creates an iterator that both filters and maps.
The returned iterator yields only the values for which the supplied
closure returns Some(value).
filter_map can be used to make chains of filter and map more
concise. The example below shows how a map().filter().map() can be
shortened to a single call to filter_map.
§Examples
Basic usage:
let a = ["1", "two", "NaN", "four", "5"];
let mut iter = a.iter().filter_map(|s| s.parse().ok());
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(5));
assert_eq!(iter.next(), None);Here’s the same example, but with filter and map:
let a = ["1", "two", "NaN", "four", "5"];
let mut iter = a.iter().map(|s| s.parse()).filter(|s| s.is_ok()).map(|s| s.unwrap());
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(5));
assert_eq!(iter.next(), None);1.0.0 (const: unstable) · Sourcefn enumerate(self) -> Enumerate<Self> ⓘwhere
Self: Sized,
fn enumerate(self) -> Enumerate<Self> ⓘwhere
Self: Sized,
Creates an iterator which gives the current iteration count as well as the next value.
The iterator returned yields pairs (i, val), where i is the
current index of iteration and val is the value returned by the
iterator.
enumerate() keeps its count as a usize. If you want to count by a
different sized integer, the zip function provides similar
functionality.
§Overflow Behavior
The method does no guarding against overflows, so enumerating more than
usize::MAX elements either produces the wrong result or panics. If
overflow checks are enabled, a panic is guaranteed.
§Panics
The returned iterator might panic if the to-be-returned index would
overflow a usize.
§Examples
let a = ['a', 'b', 'c'];
let mut iter = a.into_iter().enumerate();
assert_eq!(iter.next(), Some((0, 'a')));
assert_eq!(iter.next(), Some((1, 'b')));
assert_eq!(iter.next(), Some((2, 'c')));
assert_eq!(iter.next(), None);1.0.0 (const: unstable) · Sourcefn peekable(self) -> Peekable<Self> ⓘwhere
Self: Sized,
fn peekable(self) -> Peekable<Self> ⓘwhere
Self: Sized,
Creates an iterator which can use the peek and peek_mut methods
to look at the next element of the iterator without consuming it. See
their documentation for more information.
Note that the underlying iterator is still advanced when peek or
peek_mut are called for the first time: In order to retrieve the
next element, next is called on the underlying iterator, hence any
side effects (i.e. anything other than fetching the next value) of
the next method will occur.
§Examples
Basic usage:
let xs = [1, 2, 3];
let mut iter = xs.into_iter().peekable();
// peek() lets us see into the future
assert_eq!(iter.peek(), Some(&1));
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
// we can peek() multiple times, the iterator won't advance
assert_eq!(iter.peek(), Some(&3));
assert_eq!(iter.peek(), Some(&3));
assert_eq!(iter.next(), Some(3));
// after the iterator is finished, so is peek()
assert_eq!(iter.peek(), None);
assert_eq!(iter.next(), None);Using peek_mut to mutate the next item without advancing the
iterator:
let xs = [1, 2, 3];
let mut iter = xs.into_iter().peekable();
// `peek_mut()` lets us see into the future
assert_eq!(iter.peek_mut(), Some(&mut 1));
assert_eq!(iter.peek_mut(), Some(&mut 1));
assert_eq!(iter.next(), Some(1));
if let Some(p) = iter.peek_mut() {
assert_eq!(*p, 2);
// put a value into the iterator
*p = 1000;
}
// The value reappears as the iterator continues
assert_eq!(iter.collect::<Vec<_>>(), vec![1000, 3]);1.0.0 (const: unstable) · Sourcefn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> ⓘ
fn skip_while<P>(self, predicate: P) -> SkipWhile<Self, P> ⓘ
Creates an iterator that skips elements based on a predicate.
skip_while() takes a closure as an argument. It will call this
closure on each element of the iterator, and ignore elements
until it returns false.
After false is returned, skip_while()’s job is over, and the
rest of the elements are yielded.
§Examples
Basic usage:
let a = [-1i32, 0, 1];
let mut iter = a.into_iter().skip_while(|x| x.is_negative());
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), None);Because the closure passed to skip_while() takes a reference, and many
iterators iterate over references, this leads to a possibly confusing
situation, where the type of the closure argument is a double reference:
let s = &[-1, 0, 1];
let mut iter = s.iter().skip_while(|x| **x < 0); // need two *s!
assert_eq!(iter.next(), Some(&0));
assert_eq!(iter.next(), Some(&1));
assert_eq!(iter.next(), None);Stopping after an initial false:
let a = [-1, 0, 1, -2];
let mut iter = a.into_iter().skip_while(|&x| x < 0);
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), Some(1));
// while this would have been false, since we already got a false,
// skip_while() isn't used any more
assert_eq!(iter.next(), Some(-2));
assert_eq!(iter.next(), None);1.0.0 (const: unstable) · Sourcefn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> ⓘ
fn take_while<P>(self, predicate: P) -> TakeWhile<Self, P> ⓘ
Creates an iterator that yields elements based on a predicate.
take_while() takes a closure as an argument. It will call this
closure on each element of the iterator, and yield elements
while it returns true.
After false is returned, take_while()’s job is over, and the
rest of the elements are ignored.
§Examples
Basic usage:
let a = [-1i32, 0, 1];
let mut iter = a.into_iter().take_while(|x| x.is_negative());
assert_eq!(iter.next(), Some(-1));
assert_eq!(iter.next(), None);Because the closure passed to take_while() takes a reference, and many
iterators iterate over references, this leads to a possibly confusing
situation, where the type of the closure is a double reference:
let s = &[-1, 0, 1];
let mut iter = s.iter().take_while(|x| **x < 0); // need two *s!
assert_eq!(iter.next(), Some(&-1));
assert_eq!(iter.next(), None);Stopping after an initial false:
let a = [-1, 0, 1, -2];
let mut iter = a.into_iter().take_while(|&x| x < 0);
assert_eq!(iter.next(), Some(-1));
// We have more elements that are less than zero, but since we already
// got a false, take_while() ignores the remaining elements.
assert_eq!(iter.next(), None);Because take_while() needs to look at the value in order to see if it
should be included or not, consuming iterators will see that it is
removed:
let a = [1, 2, 3, 4];
let mut iter = a.into_iter();
let result: Vec<i32> = iter.by_ref().take_while(|&n| n != 3).collect();
assert_eq!(result, [1, 2]);
let result: Vec<i32> = iter.collect();
assert_eq!(result, [4]);The 3 is no longer there, because it was consumed in order to see if
the iteration should stop, but wasn’t placed back into the iterator.
1.57.0 (const: unstable) · Sourcefn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> ⓘ
fn map_while<B, P>(self, predicate: P) -> MapWhile<Self, P> ⓘ
Creates an iterator that both yields elements based on a predicate and maps.
map_while() takes a closure as an argument. It will call this
closure on each element of the iterator, and yield elements
while it returns Some(_).
§Examples
Basic usage:
let a = [-1i32, 4, 0, 1];
let mut iter = a.into_iter().map_while(|x| 16i32.checked_div(x));
assert_eq!(iter.next(), Some(-16));
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), None);Here’s the same example, but with take_while and map:
let a = [-1i32, 4, 0, 1];
let mut iter = a.into_iter()
.map(|x| 16i32.checked_div(x))
.take_while(|x| x.is_some())
.map(|x| x.unwrap());
assert_eq!(iter.next(), Some(-16));
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), None);Stopping after an initial None:
let a = [0, 1, 2, -3, 4, 5, -6];
let iter = a.into_iter().map_while(|x| u32::try_from(x).ok());
let vec: Vec<_> = iter.collect();
// We have more elements that could fit in u32 (such as 4, 5), but `map_while` returned `None` for `-3`
// (as the `predicate` returned `None`) and `collect` stops at the first `None` encountered.
assert_eq!(vec, [0, 1, 2]);Because map_while() needs to look at the value in order to see if it
should be included or not, consuming iterators will see that it is
removed:
let a = [1, 2, -3, 4];
let mut iter = a.into_iter();
let result: Vec<u32> = iter.by_ref()
.map_while(|n| u32::try_from(n).ok())
.collect();
assert_eq!(result, [1, 2]);
let result: Vec<i32> = iter.collect();
assert_eq!(result, [4]);The -3 is no longer there, because it was consumed in order to see if
the iteration should stop, but wasn’t placed back into the iterator.
Note that unlike take_while this iterator is not fused.
It is also not specified what this iterator returns after the first None is returned.
If you need a fused iterator, use fuse.
1.0.0 (const: unstable) · Sourcefn skip(self, n: usize) -> Skip<Self> ⓘwhere
Self: Sized,
fn skip(self, n: usize) -> Skip<Self> ⓘwhere
Self: Sized,
Creates an iterator that skips the first n elements.
skip(n) skips elements until n elements are skipped or the end of the
iterator is reached (whichever happens first). After that, all the remaining
elements are yielded. In particular, if the original iterator is too short,
then the returned iterator is empty.
Rather than overriding this method directly, instead override the nth method.
§Examples
let a = [1, 2, 3];
let mut iter = a.into_iter().skip(2);
assert_eq!(iter.next(), Some(3));
assert_eq!(iter.next(), None);1.0.0 (const: unstable) · Sourcefn take(self, n: usize) -> Take<Self> ⓘwhere
Self: Sized,
fn take(self, n: usize) -> Take<Self> ⓘwhere
Self: Sized,
Creates an iterator that yields the first n elements, or fewer
if the underlying iterator ends sooner.
take(n) yields elements until n elements are yielded or the end of
the iterator is reached (whichever happens first).
The returned iterator is a prefix of length n if the original iterator
contains at least n elements, otherwise it contains all of the
(fewer than n) elements of the original iterator.
§Examples
Basic usage:
let a = [1, 2, 3];
let mut iter = a.into_iter().take(2);
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), None);take() is often used with an infinite iterator, to make it finite:
let mut iter = (0..).take(3);
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), None);If less than n elements are available,
take will limit itself to the size of the underlying iterator:
let v = [1, 2];
let mut iter = v.into_iter().take(5);
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), None);Use by_ref to take from the iterator without consuming it, and then
continue using the original iterator:
let mut words = ["hello", "world", "of", "Rust"].into_iter();
// Take the first two words.
let hello_world: Vec<_> = words.by_ref().take(2).collect();
assert_eq!(hello_world, vec!["hello", "world"]);
// Collect the rest of the words.
// We can only do this because we used `by_ref` earlier.
let of_rust: Vec<_> = words.collect();
assert_eq!(of_rust, vec!["of", "Rust"]);1.0.0 (const: unstable) · Sourcefn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> ⓘ
fn scan<St, B, F>(self, initial_state: St, f: F) -> Scan<Self, St, F> ⓘ
An iterator adapter which, like fold, holds internal state, but
unlike fold, produces a new iterator.
scan() takes two arguments: an initial value which seeds the internal
state, and a closure with two arguments, the first being a mutable
reference to the internal state and the second an iterator element.
The closure can assign to the internal state to share state between
iterations.
On iteration, the closure will be applied to each element of the
iterator and the return value from the closure, an Option, is
returned by the next method. Thus the closure can return
Some(value) to yield value, or None to end the iteration.
§Examples
let a = [1, 2, 3, 4];
let mut iter = a.into_iter().scan(1, |state, x| {
// each iteration, we'll multiply the state by the element ...
*state = *state * x;
// ... and terminate if the state exceeds 6
if *state > 6 {
return None;
}
// ... else yield the negation of the state
Some(-*state)
});
assert_eq!(iter.next(), Some(-1));
assert_eq!(iter.next(), Some(-2));
assert_eq!(iter.next(), Some(-6));
assert_eq!(iter.next(), None);1.0.0 (const: unstable) · Sourcefn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> ⓘ
fn flat_map<U, F>(self, f: F) -> FlatMap<Self, U, F> ⓘ
Creates an iterator that works like map, but flattens nested structure.
The map adapter is very useful, but only when the closure
argument produces values. If it produces an iterator instead, there’s
an extra layer of indirection. flat_map() will remove this extra layer
on its own.
You can think of flat_map(f) as the semantic equivalent
of mapping, and then flattening as in map(f).flatten().
Another way of thinking about flat_map(): map’s closure returns
one item for each element, and flat_map()’s closure returns an
iterator for each element.
§Examples
let words = ["alpha", "beta", "gamma"];
// chars() returns an iterator
let merged: String = words.iter()
.flat_map(|s| s.chars())
.collect();
assert_eq!(merged, "alphabetagamma");1.29.0 (const: unstable) · Sourcefn flatten(self) -> Flatten<Self> ⓘ
fn flatten(self) -> Flatten<Self> ⓘ
Creates an iterator that flattens nested structure.
This is useful when you have an iterator of iterators or an iterator of things that can be turned into iterators and you want to remove one level of indirection.
§Examples
Basic usage:
let data = vec![vec![1, 2, 3, 4], vec![5, 6]];
let flattened: Vec<_> = data.into_iter().flatten().collect();
assert_eq!(flattened, [1, 2, 3, 4, 5, 6]);Mapping and then flattening:
let words = ["alpha", "beta", "gamma"];
// chars() returns an iterator
let merged: String = words.iter()
.map(|s| s.chars())
.flatten()
.collect();
assert_eq!(merged, "alphabetagamma");You can also rewrite this in terms of flat_map(), which is preferable
in this case since it conveys intent more clearly:
let words = ["alpha", "beta", "gamma"];
// chars() returns an iterator
let merged: String = words.iter()
.flat_map(|s| s.chars())
.collect();
assert_eq!(merged, "alphabetagamma");Flattening works on any IntoIterator type, including Option and Result:
let options = vec![Some(123), Some(321), None, Some(231)];
let flattened_options: Vec<_> = options.into_iter().flatten().collect();
assert_eq!(flattened_options, [123, 321, 231]);
let results = vec![Ok(123), Ok(321), Err(456), Ok(231)];
let flattened_results: Vec<_> = results.into_iter().flatten().collect();
assert_eq!(flattened_results, [123, 321, 231]);Flattening only removes one level of nesting at a time:
let d3 = [[[1, 2], [3, 4]], [[5, 6], [7, 8]]];
let d2: Vec<_> = d3.into_iter().flatten().collect();
assert_eq!(d2, [[1, 2], [3, 4], [5, 6], [7, 8]]);
let d1: Vec<_> = d3.into_iter().flatten().flatten().collect();
assert_eq!(d1, [1, 2, 3, 4, 5, 6, 7, 8]);Here we see that flatten() does not perform a “deep” flatten.
Instead, only one level of nesting is removed. That is, if you
flatten() a three-dimensional array, the result will be
two-dimensional and not one-dimensional. To get a one-dimensional
structure, you have to flatten() again.
Sourcefn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N> ⓘ
🔬This is a nightly-only experimental API. (iter_map_windows)
fn map_windows<F, R, const N: usize>(self, f: F) -> MapWindows<Self, F, N> ⓘ
iter_map_windows)Calls the given function f for each contiguous window of size N over
self and returns an iterator over the outputs of f. Like slice::windows(),
the windows during mapping overlap as well.
In the following example, the closure is called three times with the
arguments &['a', 'b'], &['b', 'c'] and &['c', 'd'] respectively.
#![feature(iter_map_windows)]
let strings = "abcd".chars()
.map_windows(|[x, y]| format!("{}+{}", x, y))
.collect::<Vec<String>>();
assert_eq!(strings, vec!["a+b", "b+c", "c+d"]);Note that the const parameter N is usually inferred by the
destructured argument in the closure.
The returned iterator yields 𝑘 − N + 1 items (where 𝑘 is the number of
items yielded by self). If 𝑘 is less than N, this method yields an
empty iterator.
§Panics
Panics if N is zero. This check will most probably get changed to a
compile time error before this method gets stabilized.
#![feature(iter_map_windows)]
let iter = std::iter::repeat(0).map_windows(|&[]| ());§Examples
Building the sums of neighboring numbers.
#![feature(iter_map_windows)]
let mut it = [1, 3, 8, 1].iter().map_windows(|&[a, b]| a + b);
assert_eq!(it.next(), Some(4)); // 1 + 3
assert_eq!(it.next(), Some(11)); // 3 + 8
assert_eq!(it.next(), Some(9)); // 8 + 1
assert_eq!(it.next(), None);Since the elements in the following example implement Copy, we can
just copy the array and get an iterator over the windows.
#![feature(iter_map_windows)]
let mut it = "ferris".chars().map_windows(|w: &[_; 3]| *w);
assert_eq!(it.next(), Some(['f', 'e', 'r']));
assert_eq!(it.next(), Some(['e', 'r', 'r']));
assert_eq!(it.next(), Some(['r', 'r', 'i']));
assert_eq!(it.next(), Some(['r', 'i', 's']));
assert_eq!(it.next(), None);You can also use this function to check the sortedness of an iterator.
For the simple case, rather use Iterator::is_sorted.
#![feature(iter_map_windows)]
let mut it = [0.5, 1.0, 3.5, 3.0, 8.5, 8.5, f32::NAN].iter()
.map_windows(|[a, b]| a <= b);
assert_eq!(it.next(), Some(true)); // 0.5 <= 1.0
assert_eq!(it.next(), Some(true)); // 1.0 <= 3.5
assert_eq!(it.next(), Some(false)); // 3.5 <= 3.0
assert_eq!(it.next(), Some(true)); // 3.0 <= 8.5
assert_eq!(it.next(), Some(true)); // 8.5 <= 8.5
assert_eq!(it.next(), Some(false)); // 8.5 <= NAN
assert_eq!(it.next(), None);For non-fused iterators, the window is reset after None is yielded.
#![feature(iter_map_windows)]
#[derive(Default)]
struct NonFusedIterator {
state: i32,
}
impl Iterator for NonFusedIterator {
type Item = i32;
fn next(&mut self) -> Option<i32> {
let val = self.state;
self.state = self.state + 1;
// Skip every 5th number
if (val + 1) % 5 == 0 {
None
} else {
Some(val)
}
}
}
let mut iter = NonFusedIterator::default();
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), Some(3));
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), Some(5));
assert_eq!(iter.next(), Some(6));
assert_eq!(iter.next(), Some(7));
assert_eq!(iter.next(), Some(8));
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), Some(10));
assert_eq!(iter.next(), Some(11));
let mut iter = NonFusedIterator::default()
.map_windows(|arr: &[_; 2]| *arr);
assert_eq!(iter.next(), Some([0, 1]));
assert_eq!(iter.next(), Some([1, 2]));
assert_eq!(iter.next(), Some([2, 3]));
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), Some([5, 6]));
assert_eq!(iter.next(), Some([6, 7]));
assert_eq!(iter.next(), Some([7, 8]));
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), Some([10, 11]));
assert_eq!(iter.next(), Some([11, 12]));
assert_eq!(iter.next(), Some([12, 13]));
assert_eq!(iter.next(), None);1.0.0 (const: unstable) · Sourcefn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
fn fuse(self) -> Fuse<Self> ⓘwhere
Self: Sized,
Creates an iterator which ends after the first None.
After an iterator returns None, future calls may or may not yield
Some(T) again. fuse() adapts an iterator, ensuring that after a
None is given, it will always return None forever.
Note that the Fuse wrapper is a no-op on iterators that implement
the FusedIterator trait. fuse() may therefore behave incorrectly
if the FusedIterator trait is improperly implemented.
§Examples
// an iterator which alternates between Some and None
struct Alternate {
state: i32,
}
impl Iterator for Alternate {
type Item = i32;
fn next(&mut self) -> Option<i32> {
let val = self.state;
self.state = self.state + 1;
// if it's even, Some(i32), else None
(val % 2 == 0).then_some(val)
}
}
let mut iter = Alternate { state: 0 };
// we can see our iterator going back and forth
assert_eq!(iter.next(), Some(0));
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), None);
// however, once we fuse it...
let mut iter = iter.fuse();
assert_eq!(iter.next(), Some(4));
assert_eq!(iter.next(), None);
// it will always return `None` after the first time.
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), None);
assert_eq!(iter.next(), None);1.0.0 (const: unstable) · Sourcefn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
fn inspect<F>(self, f: F) -> Inspect<Self, F> ⓘ
Does something with each element of an iterator, passing the value on.
When using iterators, you’ll often chain several of them together.
While working on such code, you might want to check out what’s
happening at various parts in the pipeline. To do that, insert
a call to inspect().
It’s more common for inspect() to be used as a debugging tool than to
exist in your final code, but applications may find it useful in certain
situations when errors need to be logged before being discarded.
§Examples
Basic usage:
let a = [1, 4, 2, 3];
// this iterator sequence is complex.
let sum = a.iter()
.cloned()
.filter(|x| x % 2 == 0)
.fold(0, |sum, i| sum + i);
println!("{sum}");
// let's add some inspect() calls to investigate what's happening
let sum = a.iter()
.cloned()
.inspect(|x| println!("about to filter: {x}"))
.filter(|x| x % 2 == 0)
.inspect(|x| println!("made it through filter: {x}"))
.fold(0, |sum, i| sum + i);
println!("{sum}");This will print:
6
about to filter: 1
about to filter: 4
made it through filter: 4
about to filter: 2
made it through filter: 2
about to filter: 3
6Logging errors before discarding them:
let lines = ["1", "2", "a"];
let sum: i32 = lines
.iter()
.map(|line| line.parse::<i32>())
.inspect(|num| {
if let Err(ref e) = *num {
println!("Parsing error: {e}");
}
})
.filter_map(Result::ok)
.sum();
println!("Sum: {sum}");This will print:
Parsing error: invalid digit found in string
Sum: 31.0.0 (const: unstable) · Sourcefn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
fn by_ref(&mut self) -> &mut Selfwhere
Self: Sized,
Creates a “by reference” adapter for this instance of Iterator.
Consuming method calls (direct or indirect calls to next)
on the “by reference” adapter will consume the original iterator,
but ownership-taking methods (those with a self parameter)
only take ownership of the “by reference” iterator.
This is useful for applying ownership-taking methods
(such as take in the example below)
without giving up ownership of the original iterator,
so you can use the original iterator afterwards.
Uses impl<I: Iterator + ?Sized> Iterator for &mut I { type Item = I::Item; ...}.
§Examples
let mut words = ["hello", "world", "of", "Rust"].into_iter();
// Take the first two words.
let hello_world: Vec<_> = words.by_ref().take(2).collect();
assert_eq!(hello_world, vec!["hello", "world"]);
// Collect the rest of the words.
// We can only do this because we used `by_ref` earlier.
let of_rust: Vec<_> = words.collect();
assert_eq!(of_rust, vec!["of", "Rust"]);1.0.0 (const: unstable) · Sourcefn collect<B>(self) -> B
fn collect<B>(self) -> B
Transforms an iterator into a collection.
collect() takes ownership of an iterator and produces whichever
collection type you request. The iterator itself carries no knowledge of
the eventual container; the target collection is chosen entirely by the
type you ask collect() to return. This makes collect() one of the
more powerful methods in the standard library, and it shows up in a wide
variety of contexts.
The most basic pattern in which collect() is used is to turn one
collection into another. You take a collection, call iter on it,
do a bunch of transformations, and then collect() at the end.
collect() can also create instances of types that are not typical
collections. For example, a String can be built from chars,
and an iterator of Result<T, E> items can be collected
into Result<Collection<T>, E>. See the examples below for more.
Because collect() is so general, it can cause problems with type
inference. As such, collect() is one of the few times you’ll see
the syntax affectionately known as the ‘turbofish’: ::<>. This
helps the inference algorithm understand specifically which collection
you’re trying to collect into.
§Examples
Basic usage:
let a = [1, 2, 3];
let doubled: Vec<i32> = a.iter()
.map(|x| x * 2)
.collect();
assert_eq!(vec![2, 4, 6], doubled);Note that we needed the : Vec<i32> on the left-hand side. This is because
we could collect into, for example, a VecDeque<T> instead:
use std::collections::VecDeque;
let a = [1, 2, 3];
let doubled: VecDeque<i32> = a.iter().map(|x| x * 2).collect();
assert_eq!(2, doubled[0]);
assert_eq!(4, doubled[1]);
assert_eq!(6, doubled[2]);Using the ‘turbofish’ instead of annotating doubled:
let a = [1, 2, 3];
let doubled = a.iter().map(|x| x * 2).collect::<Vec<i32>>();
assert_eq!(vec![2, 4, 6], doubled);Because collect() only cares about what you’re collecting into, you can
still use a partial type hint, _, with the turbofish:
let a = [1, 2, 3];
let doubled = a.iter().map(|x| x * 2).collect::<Vec<_>>();
assert_eq!(vec![2, 4, 6], doubled);Using collect() to make a String:
let chars = ['g', 'd', 'k', 'k', 'n'];
let hello: String = chars.into_iter()
.map(|x| x as u8)
.map(|x| (x + 1) as char)
.collect();
assert_eq!("hello", hello);If you have a list of Result<T, E>s, you can use collect() to
see if any of them failed:
let results = [Ok(1), Err("nope"), Ok(3), Err("bad")];
let result: Result<Vec<_>, &str> = results.into_iter().collect();
// gives us the first error
assert_eq!(Err("nope"), result);
let results = [Ok(1), Ok(3)];
let result: Result<Vec<_>, &str> = results.into_iter().collect();
// gives us the list of answers
assert_eq!(Ok(vec![1, 3]), result);Sourcefn try_collect<B>(
&mut self,
) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_collect)
fn try_collect<B>( &mut self, ) -> <<Self::Item as Try>::Residual as Residual<B>>::TryType
iterator_try_collect)Fallibly transforms an iterator into a collection, short circuiting if a failure is encountered.
try_collect() is a variation of collect() that allows fallible
conversions during collection. Its main use case is simplifying conversions from
iterators yielding Option<T> into Option<Collection<T>>, or similarly for other Try
types (e.g. Result).
Importantly, try_collect() doesn’t require that the outer Try type also implements FromIterator;
only the inner type produced on Try::Output must implement it. Concretely,
this means that collecting into ControlFlow<_, Vec<i32>> is valid because Vec<i32> implements
FromIterator, even though ControlFlow doesn’t.
Also, if a failure is encountered during try_collect(), the iterator is still valid and
may continue to be used, in which case it will continue iterating starting after the element that
triggered the failure. See the last example below for an example of how this works.
§Examples
Successfully collecting an iterator of Option<i32> into Option<Vec<i32>>:
#![feature(iterator_try_collect)]
let u = vec![Some(1), Some(2), Some(3)];
let v = u.into_iter().try_collect::<Vec<i32>>();
assert_eq!(v, Some(vec![1, 2, 3]));Failing to collect in the same way:
#![feature(iterator_try_collect)]
let u = vec![Some(1), Some(2), None, Some(3)];
let v = u.into_iter().try_collect::<Vec<i32>>();
assert_eq!(v, None);A similar example, but with Result:
#![feature(iterator_try_collect)]
let u: Vec<Result<i32, ()>> = vec![Ok(1), Ok(2), Ok(3)];
let v = u.into_iter().try_collect::<Vec<i32>>();
assert_eq!(v, Ok(vec![1, 2, 3]));
let u = vec![Ok(1), Ok(2), Err(()), Ok(3)];
let v = u.into_iter().try_collect::<Vec<i32>>();
assert_eq!(v, Err(()));Finally, even ControlFlow works, despite the fact that it
doesn’t implement FromIterator. Note also that the iterator can
continue to be used, even if a failure is encountered:
#![feature(iterator_try_collect)]
use core::ops::ControlFlow::{Break, Continue};
let u = [Continue(1), Continue(2), Break(3), Continue(4), Continue(5)];
let mut it = u.into_iter();
let v = it.try_collect::<Vec<_>>();
assert_eq!(v, Break(3));
let v = it.try_collect::<Vec<_>>();
assert_eq!(v, Continue(vec![4, 5]));Sourcefn collect_into<E>(self, collection: &mut E) -> &mut E
🔬This is a nightly-only experimental API. (iter_collect_into)
fn collect_into<E>(self, collection: &mut E) -> &mut E
iter_collect_into)Collects all the items from an iterator into a collection.
This method consumes the iterator and adds all its items to the passed collection. The collection is then returned, so the call chain can be continued.
This is useful when you already have a collection and want to add the iterator items to it.
This method is a convenience method to call Extend::extend, but instead of being called on a collection, it’s called on an iterator.
§Examples
Basic usage:
#![feature(iter_collect_into)]
let a = [1, 2, 3];
let mut vec: Vec::<i32> = vec![0, 1];
a.iter().map(|x| x * 2).collect_into(&mut vec);
a.iter().map(|x| x * 10).collect_into(&mut vec);
assert_eq!(vec, vec![0, 1, 2, 4, 6, 10, 20, 30]);Vec can have a manual set capacity to avoid reallocating it:
#![feature(iter_collect_into)]
let a = [1, 2, 3];
let mut vec: Vec::<i32> = Vec::with_capacity(6);
a.iter().map(|x| x * 2).collect_into(&mut vec);
a.iter().map(|x| x * 10).collect_into(&mut vec);
assert_eq!(6, vec.capacity());
assert_eq!(vec, vec![2, 4, 6, 10, 20, 30]);The returned mutable reference can be used to continue the call chain:
#![feature(iter_collect_into)]
let a = [1, 2, 3];
let mut vec: Vec::<i32> = Vec::with_capacity(6);
let count = a.iter().collect_into(&mut vec).iter().count();
assert_eq!(count, vec.len());
assert_eq!(vec, vec![1, 2, 3]);
let count = a.iter().collect_into(&mut vec).iter().count();
assert_eq!(count, vec.len());
assert_eq!(vec, vec![1, 2, 3, 1, 2, 3]);1.0.0 (const: unstable) · Sourcefn partition<B, F>(self, f: F) -> (B, B)
fn partition<B, F>(self, f: F) -> (B, B)
Consumes an iterator, creating two collections from it.
The predicate passed to partition() can return true, or false.
partition() returns a pair, all of the elements for which it returned
true, and all of the elements for which it returned false.
See also is_partitioned() and partition_in_place().
§Examples
let a = [1, 2, 3];
let (even, odd): (Vec<_>, Vec<_>) = a
.into_iter()
.partition(|n| n % 2 == 0);
assert_eq!(even, [2]);
assert_eq!(odd, [1, 3]);Sourcefn partition_in_place<'a, T, P>(self, predicate: P) -> usize
🔬This is a nightly-only experimental API. (iter_partition_in_place)
fn partition_in_place<'a, T, P>(self, predicate: P) -> usize
iter_partition_in_place)Reorders the elements of this iterator in-place according to the given predicate,
such that all those that return true precede all those that return false.
Returns the number of true elements found.
The relative order of partitioned items is not maintained.
§Current implementation
The current algorithm tries to find the first element for which the predicate evaluates to false and the last element for which it evaluates to true, and repeatedly swaps them.
Time complexity: O(n)
See also is_partitioned() and partition().
§Examples
#![feature(iter_partition_in_place)]
let mut a = [1, 2, 3, 4, 5, 6, 7];
// Partition in-place between evens and odds
let i = a.iter_mut().partition_in_place(|n| n % 2 == 0);
assert_eq!(i, 3);
assert!(a[..i].iter().all(|n| n % 2 == 0)); // evens
assert!(a[i..].iter().all(|n| n % 2 == 1)); // oddsSourcefn is_partitioned<P>(self, predicate: P) -> bool
🔬This is a nightly-only experimental API. (iter_is_partitioned)
fn is_partitioned<P>(self, predicate: P) -> bool
iter_is_partitioned)Checks if the elements of this iterator are partitioned according to the given predicate,
such that all those that return true precede all those that return false.
See also partition() and partition_in_place().
§Examples
#![feature(iter_is_partitioned)]
assert!("Iterator".chars().is_partitioned(char::is_uppercase));
assert!(!"IntoIterator".chars().is_partitioned(char::is_uppercase));1.27.0 (const: unstable) · Sourcefn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
fn try_fold<B, F, R>(&mut self, init: B, f: F) -> R
An iterator method that applies a function as long as it returns successfully, producing a single, final value.
try_fold() takes two arguments: an initial value, and a closure with
two arguments: an ‘accumulator’, and an element. The closure either
returns successfully, with the value that the accumulator should have
for the next iteration, or it returns failure, with an error value that
is propagated back to the caller immediately (short-circuiting).
The initial value is the value the accumulator will have on the first
call. If applying the closure succeeded against every element of the
iterator, try_fold() returns the final accumulator as success.
Folding is useful whenever you have a collection of something, and want to produce a single value from it.
§Note to Implementors
Several of the other (forward) methods have default implementations in
terms of this one, so try to implement this explicitly if it can
do something better than the default for loop implementation.
In particular, try to have this call try_fold() on the internal parts
from which this iterator is composed. If multiple calls are needed,
the ? operator may be convenient for chaining the accumulator value
along, but beware any invariants that need to be upheld before those
early returns. This is a &mut self method, so iteration needs to be
resumable after hitting an error here.
§Examples
Basic usage:
let a = [1, 2, 3];
// the checked sum of all of the elements of the array
let sum = a.into_iter().try_fold(0i8, |acc, x| acc.checked_add(x));
assert_eq!(sum, Some(6));Short-circuiting:
let a = [10, 20, 30, 100, 40, 50];
let mut iter = a.into_iter();
// This sum overflows when adding the 100 element
let sum = iter.try_fold(0i8, |acc, x| acc.checked_add(x));
assert_eq!(sum, None);
// Because it short-circuited, the remaining elements are still
// available through the iterator.
assert_eq!(iter.len(), 2);
assert_eq!(iter.next(), Some(40));While you cannot break from a closure, the ControlFlow type allows
a similar idea:
use std::ops::ControlFlow;
let triangular = (1..30).try_fold(0_i8, |prev, x| {
if let Some(next) = prev.checked_add(x) {
ControlFlow::Continue(next)
} else {
ControlFlow::Break(prev)
}
});
assert_eq!(triangular, ControlFlow::Break(120));
let triangular = (1..30).try_fold(0_u64, |prev, x| {
if let Some(next) = prev.checked_add(x) {
ControlFlow::Continue(next)
} else {
ControlFlow::Break(prev)
}
});
assert_eq!(triangular, ControlFlow::Continue(435));1.27.0 (const: unstable) · Sourcefn try_for_each<F, R>(&mut self, f: F) -> R
fn try_for_each<F, R>(&mut self, f: F) -> R
An iterator method that applies a fallible function to each item in the iterator, stopping at the first error and returning that error.
This can also be thought of as the fallible form of for_each()
or as the stateless version of try_fold().
§Examples
use std::fs::rename;
use std::io::{stdout, Write};
use std::path::Path;
let data = ["no_tea.txt", "stale_bread.json", "torrential_rain.png"];
let res = data.iter().try_for_each(|x| writeln!(stdout(), "{x}"));
assert!(res.is_ok());
let mut it = data.iter().cloned();
let res = it.try_for_each(|x| rename(x, Path::new(x).with_extension("old")));
assert!(res.is_err());
// It short-circuited, so the remaining items are still in the iterator:
assert_eq!(it.next(), Some("stale_bread.json"));The ControlFlow type can be used with this method for the situations
in which you’d use break and continue in a normal loop:
use std::ops::ControlFlow;
let r = (2..100).try_for_each(|x| {
if 323 % x == 0 {
return ControlFlow::Break(x)
}
ControlFlow::Continue(())
});
assert_eq!(r, ControlFlow::Break(17));1.0.0 (const: unstable) · Sourcefn fold<B, F>(self, init: B, f: F) -> B
fn fold<B, F>(self, init: B, f: F) -> B
Folds every element into an accumulator by applying an operation, returning the final result.
fold() takes two arguments: an initial value, and a closure with two
arguments: an ‘accumulator’, and an element. The closure returns the value that
the accumulator should have for the next iteration.
The initial value is the value the accumulator will have on the first call.
After applying this closure to every element of the iterator, fold()
returns the accumulator.
This operation is sometimes called ‘reduce’ or ‘inject’.
Folding is useful whenever you have a collection of something, and want to produce a single value from it.
Note: fold(), and similar methods that traverse the entire iterator,
might not terminate for infinite iterators, even on traits for which a
result is determinable in finite time.
Note: reduce() can be used to use the first element as the initial
value, if the accumulator type and item type is the same.
Note: fold() combines elements in a left-associative fashion. For associative
operators like +, the order the elements are combined in is not important, but for non-associative
operators like - the order will affect the final result.
For a right-associative version of fold(), see DoubleEndedIterator::rfold().
§Note to Implementors
Several of the other (forward) methods have default implementations in
terms of this one, so try to implement this explicitly if it can
do something better than the default for loop implementation.
In particular, try to have this call fold() on the internal parts
from which this iterator is composed.
§Examples
Basic usage:
let a = [1, 2, 3];
// the sum of all of the elements of the array
let sum = a.iter().fold(0, |acc, x| acc + x);
assert_eq!(sum, 6);Let’s walk through each step of the iteration here:
| element | acc | x | result |
|---|---|---|---|
| 0 | |||
| 1 | 0 | 1 | 1 |
| 2 | 1 | 2 | 3 |
| 3 | 3 | 3 | 6 |
And so, our final result, 6.
This example demonstrates the left-associative nature of fold():
it builds a string, starting with an initial value
and continuing with each element from the front until the back:
let numbers = [1, 2, 3, 4, 5];
let zero = "0".to_string();
let result = numbers.iter().fold(zero, |acc, &x| {
format!("({acc} + {x})")
});
assert_eq!(result, "(((((0 + 1) + 2) + 3) + 4) + 5)");It’s common for people who haven’t used iterators a lot to
use a for loop with a list of things to build up a result. Those
can be turned into fold()s:
let numbers = [1, 2, 3, 4, 5];
let mut result = 0;
// for loop:
for i in &numbers {
result = result + i;
}
// fold:
let result2 = numbers.iter().fold(0, |acc, &x| acc + x);
// they're the same
assert_eq!(result, result2);1.51.0 (const: unstable) · Sourcefn reduce<F>(self, f: F) -> Option<Self::Item>
fn reduce<F>(self, f: F) -> Option<Self::Item>
Reduces the elements to a single one, by repeatedly applying a reducing operation.
If the iterator is empty, returns None; otherwise, returns the
result of the reduction.
The reducing function is a closure with two arguments: an ‘accumulator’, and an element.
For iterators with at least one element, this is the same as fold()
with the first element of the iterator as the initial accumulator value, folding
every subsequent element into it.
§Example
let reduced: i32 = (1..10).reduce(|acc, e| acc + e).unwrap_or(0);
assert_eq!(reduced, 45);
// Which is equivalent to doing it with `fold`:
let folded: i32 = (1..10).fold(0, |acc, e| acc + e);
assert_eq!(reduced, folded);Sourcefn try_reduce<R>(
&mut self,
f: impl FnMut(Self::Item, Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
🔬This is a nightly-only experimental API. (iterator_try_reduce)
fn try_reduce<R>( &mut self, f: impl FnMut(Self::Item, Self::Item) -> R, ) -> <<R as Try>::Residual as Residual<Option<<R as Try>::Output>>>::TryType
iterator_try_reduce)Reduces the elements to a single one by repeatedly applying a reducing operation. If the closure returns a failure, the failure is propagated back to the caller immediately.
The return type of this method depends on the return type of the closure. If the closure
returns Result<Self::Item, E>, then this function will return Result<Option<Self::Item>, E>. If the closure returns Option<Self::Item>, then this function will return
Option<Option<Self::Item>>.
When called on an empty iterator, this function will return either Some(None) or
Ok(None) depending on the type of the provided closure.
For iterators with at least one element, this is essentially the same as calling
try_fold() with the first element of the iterator as the initial accumulator value.
§Examples
Safely calculate the sum of a series of numbers:
#![feature(iterator_try_reduce)]
let numbers: Vec<usize> = vec![10, 20, 5, 23, 0];
let sum = numbers.into_iter().try_reduce(|x, y| x.checked_add(y));
assert_eq!(sum, Some(Some(58)));Determine when a reduction short circuited:
#![feature(iterator_try_reduce)]
let numbers = vec![1, 2, 3, usize::MAX, 4, 5];
let sum = numbers.into_iter().try_reduce(|x, y| x.checked_add(y));
assert_eq!(sum, None);Determine when a reduction was not performed because there are no elements:
#![feature(iterator_try_reduce)]
let numbers: Vec<usize> = Vec::new();
let sum = numbers.into_iter().try_reduce(|x, y| x.checked_add(y));
assert_eq!(sum, Some(None));Use a Result instead of an Option:
#![feature(iterator_try_reduce)]
let numbers = vec!["1", "2", "3", "4", "5"];
let max: Result<Option<_>, <usize as std::str::FromStr>::Err> =
numbers.into_iter().try_reduce(|x, y| {
if x.parse::<usize>()? > y.parse::<usize>()? { Ok(x) } else { Ok(y) }
});
assert_eq!(max, Ok(Some("5")));1.0.0 (const: unstable) · Sourcefn all<F>(&mut self, f: F) -> bool
fn all<F>(&mut self, f: F) -> bool
Tests if every element of the iterator matches a predicate.
all() takes a closure that returns true or false. It applies
this closure to each element of the iterator, and if they all return
true, then so does all(). If any of them return false, it
returns false.
all() is short-circuiting; in other words, it will stop processing
as soon as it finds a false, given that no matter what else happens,
the result will also be false.
An empty iterator returns true.
§Examples
Basic usage:
let a = [1, 2, 3];
assert!(a.into_iter().all(|x| x > 0));
assert!(!a.into_iter().all(|x| x > 2));Stopping at the first false:
let a = [1, 2, 3];
let mut iter = a.into_iter();
assert!(!iter.all(|x| x != 2));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(3));1.0.0 (const: unstable) · Sourcefn any<F>(&mut self, f: F) -> bool
fn any<F>(&mut self, f: F) -> bool
Tests if any element of the iterator matches a predicate.
any() takes a closure that returns true or false. It applies
this closure to each element of the iterator, and if any of them return
true, then so does any(). If they all return false, it
returns false.
any() is short-circuiting; in other words, it will stop processing
as soon as it finds a true, given that no matter what else happens,
the result will also be true.
An empty iterator returns false.
§Examples
Basic usage:
let a = [1, 2, 3];
assert!(a.into_iter().any(|x| x > 0));
assert!(!a.into_iter().any(|x| x > 5));Stopping at the first true:
let a = [1, 2, 3];
let mut iter = a.into_iter();
assert!(iter.any(|x| x != 2));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(2));1.0.0 (const: unstable) · Sourcefn find<P>(&mut self, predicate: P) -> Option<Self::Item>
fn find<P>(&mut self, predicate: P) -> Option<Self::Item>
Searches for an element of an iterator that satisfies a predicate.
find() takes a closure that returns true or false. It applies
this closure to each element of the iterator, and if any of them return
true, then find() returns Some(element). If they all return
false, it returns None.
find() is short-circuiting; in other words, it will stop processing
as soon as the closure returns true.
Because find() takes a reference, and many iterators iterate over
references, this leads to a possibly confusing situation where the
argument is a double reference. You can see this effect in the
examples below, with &&x.
If you need the index of the element, see position().
§Examples
Basic usage:
let a = [1, 2, 3];
assert_eq!(a.into_iter().find(|&x| x == 2), Some(2));
assert_eq!(a.into_iter().find(|&x| x == 5), None);Iterating over references:
let a = [1, 2, 3];
// `iter()` yields references i.e. `&i32` and `find()` takes a
// reference to each element.
assert_eq!(a.iter().find(|&&x| x == 2), Some(&2));
assert_eq!(a.iter().find(|&&x| x == 5), None);Stopping at the first true:
let a = [1, 2, 3];
let mut iter = a.into_iter();
assert_eq!(iter.find(|&x| x == 2), Some(2));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(3));Note that iter.find(f) is equivalent to iter.filter(f).next().
1.30.0 (const: unstable) · Sourcefn find_map<B, F>(&mut self, f: F) -> Option<B>
fn find_map<B, F>(&mut self, f: F) -> Option<B>
Applies function to the elements of iterator and returns the first non-none result.
iter.find_map(f) is equivalent to iter.filter_map(f).next().
§Examples
let a = ["lol", "NaN", "2", "5"];
let first_number = a.iter().find_map(|s| s.parse().ok());
assert_eq!(first_number, Some(2));Sourcefn try_find<R>(
&mut self,
f: impl FnMut(&Self::Item) -> R,
) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
🔬This is a nightly-only experimental API. (try_find)
fn try_find<R>( &mut self, f: impl FnMut(&Self::Item) -> R, ) -> <<R as Try>::Residual as Residual<Option<Self::Item>>>::TryType
try_find)Applies function to the elements of iterator and returns the first true result or the first error.
The return type of this method depends on the return type of the closure.
If you return Result<bool, E> from the closure, you’ll get a Result<Option<Self::Item>, E>.
If you return Option<bool> from the closure, you’ll get an Option<Option<Self::Item>>.
§Examples
#![feature(try_find)]
let a = ["1", "2", "lol", "NaN", "5"];
let is_my_num = |s: &str, search: i32| -> Result<bool, std::num::ParseIntError> {
Ok(s.parse::<i32>()? == search)
};
let result = a.into_iter().try_find(|&s| is_my_num(s, 2));
assert_eq!(result, Ok(Some("2")));
let result = a.into_iter().try_find(|&s| is_my_num(s, 5));
assert!(result.is_err());This also supports other types which implement Try, not just Result.
#![feature(try_find)]
use std::num::NonZero;
let a = [3, 5, 7, 4, 9, 0, 11u32];
let result = a.into_iter().try_find(|&x| NonZero::new(x).map(|y| y.is_power_of_two()));
assert_eq!(result, Some(Some(4)));
let result = a.into_iter().take(3).try_find(|&x| NonZero::new(x).map(|y| y.is_power_of_two()));
assert_eq!(result, Some(None));
let result = a.into_iter().rev().try_find(|&x| NonZero::new(x).map(|y| y.is_power_of_two()));
assert_eq!(result, None);1.0.0 (const: unstable) · Sourcefn position<P>(&mut self, predicate: P) -> Option<usize>
fn position<P>(&mut self, predicate: P) -> Option<usize>
Searches for an element in an iterator, returning its index.
position() takes a closure that returns true or false. It applies
this closure to each element of the iterator, and if one of them
returns true, then position() returns Some(index). If all of
them return false, it returns None.
position() is short-circuiting; in other words, it will stop
processing as soon as it finds a true.
§Overflow Behavior
The method does no guarding against overflows, so if there are more
than usize::MAX non-matching elements, it either produces the wrong
result or panics. If overflow checks are enabled, a panic is
guaranteed.
§Panics
This function might panic if the iterator has more than usize::MAX
non-matching elements.
§Examples
Basic usage:
let a = [1, 2, 3];
assert_eq!(a.into_iter().position(|x| x == 2), Some(1));
assert_eq!(a.into_iter().position(|x| x == 5), None);Stopping at the first true:
let a = [1, 2, 3, 4];
let mut iter = a.into_iter();
assert_eq!(iter.position(|x| x >= 2), Some(1));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(3));
// The returned index depends on iterator state
assert_eq!(iter.position(|x| x == 4), Some(0));
1.0.0 (const: unstable) · Sourcefn rposition<P>(&mut self, predicate: P) -> Option<usize>
fn rposition<P>(&mut self, predicate: P) -> Option<usize>
Searches for an element in an iterator from the right, returning its index.
rposition() takes a closure that returns true or false. It applies
this closure to each element of the iterator, starting from the end,
and if one of them returns true, then rposition() returns
Some(index). If all of them return false, it returns None.
rposition() is short-circuiting; in other words, it will stop
processing as soon as it finds a true.
§Examples
Basic usage:
let a = [1, 2, 3];
assert_eq!(a.into_iter().rposition(|x| x == 3), Some(2));
assert_eq!(a.into_iter().rposition(|x| x == 5), None);Stopping at the first true:
let a = [-1, 2, 3, 4];
let mut iter = a.into_iter();
assert_eq!(iter.rposition(|x| x >= 2), Some(3));
// we can still use `iter`, as there are more elements.
assert_eq!(iter.next(), Some(-1));
assert_eq!(iter.next_back(), Some(3));1.0.0 (const: unstable) · Sourcefn max(self) -> Option<Self::Item>
fn max(self) -> Option<Self::Item>
Returns the maximum element of an iterator.
If several elements are equally maximum, the last element is
returned. If the iterator is empty, None is returned.
Note that f32/f64 doesn’t implement Ord due to NaN being
incomparable. You can work around this by using Iterator::reduce:
assert_eq!(
[2.4, f32::NAN, 1.3]
.into_iter()
.reduce(f32::max)
.unwrap_or(0.),
2.4
);§Examples
let a = [1, 2, 3];
let b: [u32; 0] = [];
assert_eq!(a.into_iter().max(), Some(3));
assert_eq!(b.into_iter().max(), None);1.0.0 (const: unstable) · Sourcefn min(self) -> Option<Self::Item>
fn min(self) -> Option<Self::Item>
Returns the minimum element of an iterator.
If several elements are equally minimum, the first element is returned.
If the iterator is empty, None is returned.
Note that f32/f64 doesn’t implement Ord due to NaN being
incomparable. You can work around this by using Iterator::reduce:
assert_eq!(
[2.4, f32::NAN, 1.3]
.into_iter()
.reduce(f32::min)
.unwrap_or(0.),
1.3
);§Examples
let a = [1, 2, 3];
let b: [u32; 0] = [];
assert_eq!(a.into_iter().min(), Some(1));
assert_eq!(b.into_iter().min(), None);1.6.0 (const: unstable) · Sourcefn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn max_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 (const: unstable) · Sourcefn max_by<F>(self, compare: F) -> Option<Self::Item>
fn max_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the maximum value with respect to the specified comparison function.
If several elements are equally maximum, the last element is
returned. If the iterator is empty, None is returned.
§Examples
let a = [-3_i32, 0, 1, 5, -10];
assert_eq!(a.into_iter().max_by(|x, y| x.cmp(y)).unwrap(), 5);1.6.0 (const: unstable) · Sourcefn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
fn min_by_key<B, F>(self, f: F) -> Option<Self::Item>
1.15.0 (const: unstable) · Sourcefn min_by<F>(self, compare: F) -> Option<Self::Item>
fn min_by<F>(self, compare: F) -> Option<Self::Item>
Returns the element that gives the minimum value with respect to the specified comparison function.
If several elements are equally minimum, the first element is
returned. If the iterator is empty, None is returned.
§Examples
let a = [-3_i32, 0, 1, 5, -10];
assert_eq!(a.into_iter().min_by(|x, y| x.cmp(y)).unwrap(), -10);1.0.0 (const: unstable) · Sourcefn rev(self) -> Rev<Self> ⓘwhere
Self: Sized + DoubleEndedIterator,
fn rev(self) -> Rev<Self> ⓘwhere
Self: Sized + DoubleEndedIterator,
Reverses an iterator’s direction.
Usually, iterators iterate from left to right. After using rev(),
an iterator will instead iterate from right to left.
This is only possible if the iterator has an end, so rev() only
works on DoubleEndedIterators.
§Examples
let a = [1, 2, 3];
let mut iter = a.into_iter().rev();
assert_eq!(iter.next(), Some(3));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), None);1.0.0 (const: unstable) · Sourcefn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
fn unzip<A, B, FromA, FromB>(self) -> (FromA, FromB)
Converts an iterator of pairs into a pair of containers.
unzip() consumes an entire iterator of pairs, producing two
collections: one from the left elements of the pairs, and one
from the right elements.
This function is, in some sense, the opposite of zip.
§Examples
let a = [(1, 2), (3, 4), (5, 6)];
let (left, right): (Vec<_>, Vec<_>) = a.into_iter().unzip();
assert_eq!(left, [1, 3, 5]);
assert_eq!(right, [2, 4, 6]);
// you can also unzip multiple nested tuples at once
let a = [(1, (2, 3)), (4, (5, 6))];
let (x, (y, z)): (Vec<_>, (Vec<_>, Vec<_>)) = a.into_iter().unzip();
assert_eq!(x, [1, 4]);
assert_eq!(y, [2, 5]);
assert_eq!(z, [3, 6]);1.36.0 (const: unstable) · Sourcefn copied<'a, T>(self) -> Copied<Self> ⓘ
fn copied<'a, T>(self) -> Copied<Self> ⓘ
Creates an iterator which copies all of its elements.
This is useful when you have an iterator over &T, but you need an
iterator over T.
§Examples
let a = [1, 2, 3];
let v_copied: Vec<_> = a.iter().copied().collect();
// copied is the same as .map(|&x| x)
let v_map: Vec<_> = a.iter().map(|&x| x).collect();
assert_eq!(v_copied, [1, 2, 3]);
assert_eq!(v_map, [1, 2, 3]);1.0.0 (const: unstable) · Sourcefn cloned<'a, T>(self) -> Cloned<Self> ⓘ
fn cloned<'a, T>(self) -> Cloned<Self> ⓘ
Creates an iterator which clones all of its elements.
This is useful when you have an iterator over &T, but you need an
iterator over T.
There is no guarantee whatsoever about the clone method actually
being called or optimized away. So code should not depend on
either.
§Examples
Basic usage:
let a = [1, 2, 3];
let v_cloned: Vec<_> = a.iter().cloned().collect();
// cloned is the same as .map(|&x| x), for integers
let v_map: Vec<_> = a.iter().map(|&x| x).collect();
assert_eq!(v_cloned, [1, 2, 3]);
assert_eq!(v_map, [1, 2, 3]);To get the best performance, try to clone late:
let a = [vec![0_u8, 1, 2], vec![3, 4], vec![23]];
// don't do this:
let slower: Vec<_> = a.iter().cloned().filter(|s| s.len() == 1).collect();
assert_eq!(&[vec![23]], &slower[..]);
// instead call `cloned` late
let faster: Vec<_> = a.iter().filter(|s| s.len() == 1).cloned().collect();
assert_eq!(&[vec![23]], &faster[..]);1.0.0 (const: unstable) · Sourcefn cycle(self) -> Cycle<Self> ⓘ
fn cycle(self) -> Cycle<Self> ⓘ
Repeats an iterator endlessly.
Instead of stopping at None, the iterator will instead start again,
from the beginning. After iterating again, it will start at the
beginning again. And again. And again. Forever. Note that in case the
original iterator is empty, the resulting iterator will also be empty.
§Examples
let a = [1, 2, 3];
let mut iter = a.into_iter().cycle();
loop {
assert_eq!(iter.next(), Some(1));
assert_eq!(iter.next(), Some(2));
assert_eq!(iter.next(), Some(3));
}Sourcefn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N> ⓘwhere
Self: Sized,
🔬This is a nightly-only experimental API. (iter_array_chunks)
fn array_chunks<const N: usize>(self) -> ArrayChunks<Self, N> ⓘwhere
Self: Sized,
iter_array_chunks)Returns an iterator over N elements of the iterator at a time.
The chunks do not overlap. If N does not divide the length of the
iterator, then the last up to N-1 elements will be omitted and can be
retrieved from the .into_remainder()
function of the iterator.
§Panics
Panics if N is zero.
§Examples
Basic usage:
#![feature(iter_array_chunks)]
let mut iter = "lorem".chars().array_chunks();
assert_eq!(iter.next(), Some(['l', 'o']));
assert_eq!(iter.next(), Some(['r', 'e']));
assert_eq!(iter.next(), None);
assert_eq!(iter.into_remainder().as_slice(), &['m']);#![feature(iter_array_chunks)]
let data = [1, 1, 2, -2, 6, 0, 3, 1];
// ^-----^ ^------^
for [x, y, z] in data.iter().array_chunks() {
assert_eq!(x + y + z, 4);
}1.11.0 (const: unstable) · Sourcefn sum<S>(self) -> S
fn sum<S>(self) -> S
Sums the elements of an iterator.
Takes each element, adds them together, and returns the result.
An empty iterator returns the additive identity (“zero”) of the type,
which is 0 for integers and -0.0 for floats.
sum() can be used to sum any type implementing Sum,
including Option and Result.
§Panics
When calling sum() and a primitive integer type is being returned, this
method will panic if the computation overflows and overflow checks are
enabled.
§Examples
let a = [1, 2, 3];
let sum: i32 = a.iter().sum();
assert_eq!(sum, 6);
let b: Vec<f32> = vec![];
let sum: f32 = b.iter().sum();
assert_eq!(sum, -0.0_f32);1.11.0 (const: unstable) · Sourcefn product<P>(self) -> P
fn product<P>(self) -> P
Iterates over the entire iterator, multiplying all the elements.
An empty iterator returns the one value of the type.
product() can be used to multiply any type implementing Product,
including Option and Result.
§Panics
When calling product() and a primitive integer type is being returned,
method will panic if the computation overflows and overflow checks are
enabled.
§Examples
fn factorial(n: u32) -> u32 {
(1..=n).product()
}
assert_eq!(factorial(0), 1);
assert_eq!(factorial(1), 1);
assert_eq!(factorial(5), 120);1.5.0 (const: unstable) · Sourcefn cmp<I>(self, other: I) -> Ordering
fn cmp<I>(self, other: I) -> Ordering
Lexicographically compares the elements of this Iterator with those
of another.
§Examples
use std::cmp::Ordering;
assert_eq!([1].iter().cmp([1].iter()), Ordering::Equal);
assert_eq!([1].iter().cmp([1, 2].iter()), Ordering::Less);
assert_eq!([1, 2].iter().cmp([1].iter()), Ordering::Greater);Sourcefn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
🔬This is a nightly-only experimental API. (iter_order_by)
fn cmp_by<I, F>(self, other: I, cmp: F) -> Ordering
iter_order_by)Lexicographically compares the elements of this Iterator with those
of another with respect to the specified comparison function.
§Examples
#![feature(iter_order_by)]
use std::cmp::Ordering;
let xs = [1, 2, 3, 4];
let ys = [1, 4, 9, 16];
assert_eq!(xs.into_iter().cmp_by(ys, |x, y| x.cmp(&y)), Ordering::Less);
assert_eq!(xs.into_iter().cmp_by(ys, |x, y| (x * x).cmp(&y)), Ordering::Equal);
assert_eq!(xs.into_iter().cmp_by(ys, |x, y| (2 * x).cmp(&y)), Ordering::Greater);1.5.0 (const: unstable) · Sourcefn partial_cmp<I>(self, other: I) -> Option<Ordering>
fn partial_cmp<I>(self, other: I) -> Option<Ordering>
Lexicographically compares the PartialOrd elements of
this Iterator with those of another. The comparison works like short-circuit
evaluation, returning a result without comparing the remaining elements.
As soon as an order can be determined, the evaluation stops and a result is returned.
§Examples
use std::cmp::Ordering;
assert_eq!([1.].iter().partial_cmp([1.].iter()), Some(Ordering::Equal));
assert_eq!([1.].iter().partial_cmp([1., 2.].iter()), Some(Ordering::Less));
assert_eq!([1., 2.].iter().partial_cmp([1.].iter()), Some(Ordering::Greater));For floating-point numbers, NaN does not have a total order and will result
in None when compared:
assert_eq!([f64::NAN].iter().partial_cmp([1.].iter()), None);The results are determined by the order of evaluation.
use std::cmp::Ordering;
assert_eq!([1.0, f64::NAN].iter().partial_cmp([2.0, f64::NAN].iter()), Some(Ordering::Less));
assert_eq!([2.0, f64::NAN].iter().partial_cmp([1.0, f64::NAN].iter()), Some(Ordering::Greater));
assert_eq!([f64::NAN, 1.0].iter().partial_cmp([f64::NAN, 2.0].iter()), None);Sourcefn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
🔬This is a nightly-only experimental API. (iter_order_by)
fn partial_cmp_by<I, F>(self, other: I, partial_cmp: F) -> Option<Ordering>where
Self: Sized,
I: IntoIterator,
F: FnMut(Self::Item, <I as IntoIterator>::Item) -> Option<Ordering>,
iter_order_by)Lexicographically compares the elements of this Iterator with those
of another with respect to the specified comparison function.
§Examples
#![feature(iter_order_by)]
use std::cmp::Ordering;
let xs = [1.0, 2.0, 3.0, 4.0];
let ys = [1.0, 4.0, 9.0, 16.0];
assert_eq!(
xs.iter().partial_cmp_by(ys, |x, y| x.partial_cmp(&y)),
Some(Ordering::Less)
);
assert_eq!(
xs.iter().partial_cmp_by(ys, |x, y| (x * x).partial_cmp(&y)),
Some(Ordering::Equal)
);
assert_eq!(
xs.iter().partial_cmp_by(ys, |x, y| (2.0 * x).partial_cmp(&y)),
Some(Ordering::Greater)
);Sourcefn eq_by<I, F>(self, other: I, eq: F) -> bool
🔬This is a nightly-only experimental API. (iter_order_by)
fn eq_by<I, F>(self, other: I, eq: F) -> bool
iter_order_by)1.5.0 (const: unstable) · Sourcefn lt<I>(self, other: I) -> bool
fn lt<I>(self, other: I) -> bool
Determines if the elements of this Iterator are lexicographically
less than those of another.
§Examples
assert_eq!([1].iter().lt([1].iter()), false);
assert_eq!([1].iter().lt([1, 2].iter()), true);
assert_eq!([1, 2].iter().lt([1].iter()), false);
assert_eq!([1, 2].iter().lt([1, 2].iter()), false);1.5.0 (const: unstable) · Sourcefn le<I>(self, other: I) -> bool
fn le<I>(self, other: I) -> bool
Determines if the elements of this Iterator are lexicographically
less or equal to those of another.
§Examples
assert_eq!([1].iter().le([1].iter()), true);
assert_eq!([1].iter().le([1, 2].iter()), true);
assert_eq!([1, 2].iter().le([1].iter()), false);
assert_eq!([1, 2].iter().le([1, 2].iter()), true);1.5.0 (const: unstable) · Sourcefn gt<I>(self, other: I) -> bool
fn gt<I>(self, other: I) -> bool
Determines if the elements of this Iterator are lexicographically
greater than those of another.
§Examples
assert_eq!([1].iter().gt([1].iter()), false);
assert_eq!([1].iter().gt([1, 2].iter()), false);
assert_eq!([1, 2].iter().gt([1].iter()), true);
assert_eq!([1, 2].iter().gt([1, 2].iter()), false);1.5.0 (const: unstable) · Sourcefn ge<I>(self, other: I) -> bool
fn ge<I>(self, other: I) -> bool
Determines if the elements of this Iterator are lexicographically
greater than or equal to those of another.
§Examples
assert_eq!([1].iter().ge([1].iter()), true);
assert_eq!([1].iter().ge([1, 2].iter()), false);
assert_eq!([1, 2].iter().ge([1].iter()), true);
assert_eq!([1, 2].iter().ge([1, 2].iter()), true);1.82.0 (const: unstable) · Sourcefn is_sorted(self) -> bool
fn is_sorted(self) -> bool
Checks if the elements of this iterator are sorted.
That is, for each element a and its following element b, a <= b must hold. If the
iterator yields exactly zero or one element, true is returned.
Note that if Self::Item is only PartialOrd, but not Ord, the above definition
implies that this function returns false if any two consecutive items are not
comparable.
§Examples
assert!([1, 2, 2, 9].iter().is_sorted());
assert!(![1, 3, 2, 4].iter().is_sorted());
assert!([0].iter().is_sorted());
assert!(std::iter::empty::<i32>().is_sorted());
assert!(![0.0, 1.0, f32::NAN].iter().is_sorted());1.82.0 (const: unstable) · Sourcefn is_sorted_by<F>(self, compare: F) -> bool
fn is_sorted_by<F>(self, compare: F) -> bool
Checks if the elements of this iterator are sorted using the given comparator function.
Instead of using PartialOrd::partial_cmp, this function uses the given compare
function to determine whether two elements are to be considered in sorted order.
§Examples
assert!([1, 2, 2, 9].iter().is_sorted_by(|a, b| a <= b));
assert!(![1, 2, 2, 9].iter().is_sorted_by(|a, b| a < b));
assert!([0].iter().is_sorted_by(|a, b| true));
assert!([0].iter().is_sorted_by(|a, b| false));
assert!(std::iter::empty::<i32>().is_sorted_by(|a, b| false));
assert!(std::iter::empty::<i32>().is_sorted_by(|a, b| true));1.82.0 (const: unstable) · Sourcefn is_sorted_by_key<F, K>(self, f: F) -> bool
fn is_sorted_by_key<F, K>(self, f: F) -> bool
Checks if the elements of this iterator are sorted using the given key extraction function.
Instead of comparing the iterator’s elements directly, this function compares the keys of
the elements, as determined by f. Apart from that, it’s equivalent to is_sorted; see
its documentation for more information.
§Examples
assert!(["c", "bb", "aaa"].iter().is_sorted_by_key(|s| s.len()));
assert!(![-2i32, -1, 0, 3].iter().is_sorted_by_key(|n| n.abs()));Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl<'a, I, A> !Iterator for &'a Box<[I], A>where
A: Allocator,
This implementation is required to make sure that the &Box<[I]>: IntoIterator
implementation doesn’t overlap with IntoIterator for T where T: Iterator blanket.
impl<'a, I, A> !Iterator for &'a mut Box<[I], A>where
A: Allocator,
This implementation is required to make sure that the &mut Box<[I]>: IntoIterator
implementation doesn’t overlap with IntoIterator for T where T: Iterator blanket.
impl<I, A> !Iterator for Box<[I], A>where
A: Allocator,
This implementation is required to make sure that the Box<[I]>: IntoIterator
implementation doesn’t overlap with IntoIterator for T where T: Iterator blanket.
impl<T> !Iterator for [T]
Source§impl<'a> Iterator for IterableReport<'a>
Available on crate feature binder only.
impl<'a> Iterator for IterableReport<'a>
binder only.Source§impl<'a> Iterator for IterableDummy<'a>
impl<'a> Iterator for IterableDummy<'a>
Source§impl<'a> Iterator for IterableNlmsgerrAttrs<'a>
impl<'a> Iterator for IterableNlmsgerrAttrs<'a>
type Item = Result<NlmsgerrAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterablePolicyTypeAttrs<'a>
impl<'a> Iterator for IterablePolicyTypeAttrs<'a>
type Item = Result<PolicyTypeAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableConntrackAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableConntrackAttrs<'a>
conntrack only.type Item = Result<ConntrackAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableConntrackStatsAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableConntrackStatsAttrs<'a>
conntrack only.type Item = Result<ConntrackStatsAttrs, ErrorContext>
Source§impl<'a> Iterator for netlink_bindings::conntrack::IterableCounterAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for netlink_bindings::conntrack::IterableCounterAttrs<'a>
conntrack only.type Item = Result<CounterAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableHelpAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableHelpAttrs<'a>
conntrack only.Source§impl<'a> Iterator for netlink_bindings::conntrack::IterableNatAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for netlink_bindings::conntrack::IterableNatAttrs<'a>
conntrack only.Source§impl<'a> Iterator for IterableNatProtoAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableNatProtoAttrs<'a>
conntrack only.type Item = Result<NatProtoAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableProtoinfoAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableProtoinfoAttrs<'a>
conntrack only.type Item = Result<ProtoinfoAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableProtoinfoDccpAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableProtoinfoDccpAttrs<'a>
conntrack only.type Item = Result<ProtoinfoDccpAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableProtoinfoSctpAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableProtoinfoSctpAttrs<'a>
conntrack only.type Item = Result<ProtoinfoSctpAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableProtoinfoTcpAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableProtoinfoTcpAttrs<'a>
conntrack only.type Item = Result<ProtoinfoTcpAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableSecctxAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableSecctxAttrs<'a>
conntrack only.type Item = Result<SecctxAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSeqadjAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableSeqadjAttrs<'a>
conntrack only.type Item = Result<SeqadjAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableSynproxyAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableSynproxyAttrs<'a>
conntrack only.type Item = Result<SynproxyAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableTupleAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableTupleAttrs<'a>
conntrack only.type Item = Result<TupleAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTupleIpAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableTupleIpAttrs<'a>
conntrack only.type Item = Result<TupleIpAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableTupleProtoAttrs<'a>
Available on crate feature conntrack only.
impl<'a> Iterator for IterableTupleProtoAttrs<'a>
conntrack only.type Item = Result<TupleProtoAttrs, ErrorContext>
Source§impl<'a> Iterator for IterablePerfDomain<'a>
Available on crate feature dev-energymodel only.
impl<'a> Iterator for IterablePerfDomain<'a>
dev-energymodel only.type Item = Result<PerfDomain<'a>, ErrorContext>
Source§impl<'a> Iterator for IterablePerfState<'a>
Available on crate feature dev-energymodel only.
impl<'a> Iterator for IterablePerfState<'a>
dev-energymodel only.Source§impl<'a> Iterator for IterablePerfTable<'a>
Available on crate feature dev-energymodel only.
impl<'a> Iterator for IterablePerfTable<'a>
dev-energymodel only.Source§impl<'a> Iterator for IterableDevlink<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDevlink<'a>
devlink only.Source§impl<'a> Iterator for IterableDlAttrStats<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlAttrStats<'a>
devlink only.type Item = Result<DlAttrStats, ErrorContext>
Source§impl<'a> Iterator for IterableDlDevStats<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDevStats<'a>
devlink only.type Item = Result<DlDevStats<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeAction<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeAction<'a>
devlink only.type Item = Result<DlDpipeAction, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeActionValue<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeActionValue<'a>
devlink only.type Item = Result<DlDpipeActionValue<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeEntries<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeEntries<'a>
devlink only.type Item = Result<DlDpipeEntries<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeEntry<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeEntry<'a>
devlink only.type Item = Result<DlDpipeEntry<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeEntryActionValues<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeEntryActionValues<'a>
devlink only.type Item = Result<DlDpipeEntryActionValues<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeEntryMatchValues<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeEntryMatchValues<'a>
devlink only.type Item = Result<DlDpipeEntryMatchValues<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeField<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeField<'a>
devlink only.type Item = Result<DlDpipeField<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeHeader<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeHeader<'a>
devlink only.type Item = Result<DlDpipeHeader<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeHeaderFields<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeHeaderFields<'a>
devlink only.type Item = Result<DlDpipeHeaderFields<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeHeaders<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeHeaders<'a>
devlink only.type Item = Result<DlDpipeHeaders<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeMatch<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeMatch<'a>
devlink only.type Item = Result<DlDpipeMatch, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeMatchValue<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeMatchValue<'a>
devlink only.type Item = Result<DlDpipeMatchValue<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeTable<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeTable<'a>
devlink only.type Item = Result<DlDpipeTable<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeTableActions<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeTableActions<'a>
devlink only.type Item = Result<DlDpipeTableActions<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeTableMatches<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeTableMatches<'a>
devlink only.type Item = Result<DlDpipeTableMatches<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlDpipeTables<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlDpipeTables<'a>
devlink only.type Item = Result<DlDpipeTables<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlFmsg<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlFmsg<'a>
devlink only.Source§impl<'a> Iterator for IterableDlHealthReporter<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlHealthReporter<'a>
devlink only.type Item = Result<DlHealthReporter<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlInfoVersion<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlInfoVersion<'a>
devlink only.type Item = Result<DlInfoVersion<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlLinecardSupportedTypes<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlLinecardSupportedTypes<'a>
devlink only.type Item = Result<DlLinecardSupportedTypes<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlParam<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlParam<'a>
devlink only.Source§impl<'a> Iterator for IterableDlPortFunction<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlPortFunction<'a>
devlink only.type Item = Result<DlPortFunction<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlRateTcBws<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlRateTcBws<'a>
devlink only.type Item = Result<DlRateTcBws, ErrorContext>
Source§impl<'a> Iterator for IterableDlRegionChunk<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlRegionChunk<'a>
devlink only.type Item = Result<DlRegionChunk<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlRegionChunks<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlRegionChunks<'a>
devlink only.type Item = Result<DlRegionChunks<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlRegionSnapshot<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlRegionSnapshot<'a>
devlink only.type Item = Result<DlRegionSnapshot, ErrorContext>
Source§impl<'a> Iterator for IterableDlRegionSnapshots<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlRegionSnapshots<'a>
devlink only.type Item = Result<DlRegionSnapshots<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlReloadActInfo<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlReloadActInfo<'a>
devlink only.type Item = Result<DlReloadActInfo<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlReloadActStats<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlReloadActStats<'a>
devlink only.type Item = Result<DlReloadActStats<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlReloadStats<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlReloadStats<'a>
devlink only.type Item = Result<DlReloadStats<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlReloadStatsEntry<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlReloadStatsEntry<'a>
devlink only.type Item = Result<DlReloadStatsEntry, ErrorContext>
Source§impl<'a> Iterator for IterableDlResource<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlResource<'a>
devlink only.type Item = Result<DlResource<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlResourceList<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlResourceList<'a>
devlink only.type Item = Result<DlResourceList<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDlSelftestId<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlSelftestId<'a>
devlink only.type Item = Result<DlSelftestId, ErrorContext>
Source§impl<'a> Iterator for IterableDlTrapMetadata<'a>
Available on crate feature devlink only.
impl<'a> Iterator for IterableDlTrapMetadata<'a>
devlink only.type Item = Result<DlTrapMetadata, ErrorContext>
Source§impl<'a> Iterator for IterableDpll<'a>
Available on crate feature dpll only.
impl<'a> Iterator for IterableDpll<'a>
dpll only.Source§impl<'a> Iterator for IterableFrequencyRange<'a>
Available on crate feature dpll only.
impl<'a> Iterator for IterableFrequencyRange<'a>
dpll only.type Item = Result<FrequencyRange, ErrorContext>
Source§impl<'a> Iterator for IterablePin<'a>
Available on crate feature dpll only.
impl<'a> Iterator for IterablePin<'a>
dpll only.Source§impl<'a> Iterator for IterablePinParentDevice<'a>
Available on crate feature dpll only.
impl<'a> Iterator for IterablePinParentDevice<'a>
dpll only.type Item = Result<PinParentDevice, ErrorContext>
Source§impl<'a> Iterator for IterablePinParentPin<'a>
Available on crate feature dpll only.
impl<'a> Iterator for IterablePinParentPin<'a>
dpll only.type Item = Result<PinParentPin, ErrorContext>
Source§impl<'a> Iterator for IterableReferenceSync<'a>
Available on crate feature dpll only.
impl<'a> Iterator for IterableReferenceSync<'a>
dpll only.type Item = Result<ReferenceSync, ErrorContext>
Source§impl<'a> Iterator for IterableErrorCounterAttrs<'a>
Available on crate feature drm-ras only.
impl<'a> Iterator for IterableErrorCounterAttrs<'a>
drm-ras only.type Item = Result<ErrorCounterAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableNodeAttrs<'a>
Available on crate feature drm-ras only.
impl<'a> Iterator for IterableNodeAttrs<'a>
drm-ras only.Source§impl<'a> Iterator for IterableBitset<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableBitset<'a>
ethtool only.Source§impl<'a> Iterator for IterableBitsetBit<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableBitsetBit<'a>
ethtool only.Source§impl<'a> Iterator for IterableBitsetBits<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableBitsetBits<'a>
ethtool only.type Item = Result<BitsetBits<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableC33PsePwLimit<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableC33PsePwLimit<'a>
ethtool only.type Item = Result<C33PsePwLimit, ErrorContext>
Source§impl<'a> Iterator for IterableCableFaultLength<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableCableFaultLength<'a>
ethtool only.type Item = Result<CableFaultLength, ErrorContext>
Source§impl<'a> Iterator for IterableCableNest<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableCableNest<'a>
ethtool only.Source§impl<'a> Iterator for IterableCableResult<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableCableResult<'a>
ethtool only.type Item = Result<CableResult, ErrorContext>
Source§impl<'a> Iterator for IterableCableTest<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableCableTest<'a>
ethtool only.Source§impl<'a> Iterator for IterableCableTestNtf<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableCableTestNtf<'a>
ethtool only.type Item = Result<CableTestNtf<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCableTestTdr<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableCableTestTdr<'a>
ethtool only.type Item = Result<CableTestTdr<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCableTestTdrCfg<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableCableTestTdrCfg<'a>
ethtool only.type Item = Result<CableTestTdrCfg, ErrorContext>
Source§impl<'a> Iterator for IterableCableTestTdrNtf<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableCableTestTdrNtf<'a>
ethtool only.type Item = Result<CableTestTdrNtf<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableChannels<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableChannels<'a>
ethtool only.Source§impl<'a> Iterator for IterableCoalesce<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableCoalesce<'a>
ethtool only.Source§impl<'a> Iterator for IterableDebug<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableDebug<'a>
ethtool only.Source§impl<'a> Iterator for IterableEee<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableEee<'a>
ethtool only.Source§impl<'a> Iterator for IterableFeatures<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableFeatures<'a>
ethtool only.Source§impl<'a> Iterator for IterableFec<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableFec<'a>
ethtool only.Source§impl<'a> Iterator for IterableFecHist<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableFecHist<'a>
ethtool only.Source§impl<'a> Iterator for IterableFecStat<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableFecStat<'a>
ethtool only.Source§impl<'a> Iterator for IterableFlow<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableFlow<'a>
ethtool only.Source§impl<'a> Iterator for IterableHeader<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableHeader<'a>
ethtool only.Source§impl<'a> Iterator for IterableIrqModeration<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableIrqModeration<'a>
ethtool only.type Item = Result<IrqModeration, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfo<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableLinkinfo<'a>
ethtool only.Source§impl<'a> Iterator for IterableLinkmodes<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableLinkmodes<'a>
ethtool only.Source§impl<'a> Iterator for IterableLinkstate<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableLinkstate<'a>
ethtool only.Source§impl<'a> Iterator for IterableMm<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableMm<'a>
ethtool only.Source§impl<'a> Iterator for IterableMmStat<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableMmStat<'a>
ethtool only.Source§impl<'a> Iterator for IterableModule<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableModule<'a>
ethtool only.Source§impl<'a> Iterator for IterableModuleEeprom<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableModuleEeprom<'a>
ethtool only.type Item = Result<ModuleEeprom<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableModuleFwFlash<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableModuleFwFlash<'a>
ethtool only.type Item = Result<ModuleFwFlash<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableMse<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableMse<'a>
ethtool only.Source§impl<'a> Iterator for IterableMseCapabilities<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableMseCapabilities<'a>
ethtool only.type Item = Result<MseCapabilities, ErrorContext>
Source§impl<'a> Iterator for IterableMseSnapshot<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableMseSnapshot<'a>
ethtool only.type Item = Result<MseSnapshot, ErrorContext>
Source§impl<'a> Iterator for IterablePause<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterablePause<'a>
ethtool only.Source§impl<'a> Iterator for IterablePauseStat<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterablePauseStat<'a>
ethtool only.Source§impl<'a> Iterator for IterablePhcVclocks<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterablePhcVclocks<'a>
ethtool only.type Item = Result<PhcVclocks<'a>, ErrorContext>
Source§impl<'a> Iterator for IterablePhy<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterablePhy<'a>
ethtool only.Source§impl<'a> Iterator for IterablePlca<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterablePlca<'a>
ethtool only.Source§impl<'a> Iterator for IterablePrivflags<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterablePrivflags<'a>
ethtool only.Source§impl<'a> Iterator for IterableProfile<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableProfile<'a>
ethtool only.Source§impl<'a> Iterator for IterablePse<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterablePse<'a>
ethtool only.Source§impl<'a> Iterator for IterablePseNtf<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterablePseNtf<'a>
ethtool only.Source§impl<'a> Iterator for IterableRings<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableRings<'a>
ethtool only.Source§impl<'a> Iterator for IterableRss<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableRss<'a>
ethtool only.Source§impl<'a> Iterator for netlink_bindings::ethtool::IterableStats<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for netlink_bindings::ethtool::IterableStats<'a>
ethtool only.Source§impl<'a> Iterator for IterableStatsGrp<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableStatsGrp<'a>
ethtool only.Source§impl<'a> Iterator for IterableStatsGrpHist<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableStatsGrpHist<'a>
ethtool only.type Item = Result<StatsGrpHist, ErrorContext>
Source§impl<'a> Iterator for IterableString<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableString<'a>
ethtool only.Source§impl<'a> Iterator for IterableStrings<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableStrings<'a>
ethtool only.Source§impl<'a> Iterator for IterableStringset<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableStringset<'a>
ethtool only.Source§impl<'a> Iterator for IterableStringsets<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableStringsets<'a>
ethtool only.type Item = Result<Stringsets<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableStrset<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableStrset<'a>
ethtool only.Source§impl<'a> Iterator for IterableTsHwtstampProvider<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableTsHwtstampProvider<'a>
ethtool only.type Item = Result<TsHwtstampProvider, ErrorContext>
Source§impl<'a> Iterator for IterableTsStat<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableTsStat<'a>
ethtool only.Source§impl<'a> Iterator for IterableTsconfig<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableTsconfig<'a>
ethtool only.Source§impl<'a> Iterator for IterableTsinfo<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableTsinfo<'a>
ethtool only.Source§impl<'a> Iterator for IterableTunnelInfo<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableTunnelInfo<'a>
ethtool only.type Item = Result<TunnelInfo<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTunnelUdp<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableTunnelUdp<'a>
ethtool only.Source§impl<'a> Iterator for IterableTunnelUdpEntry<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableTunnelUdpEntry<'a>
ethtool only.type Item = Result<TunnelUdpEntry, ErrorContext>
Source§impl<'a> Iterator for IterableTunnelUdpTable<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableTunnelUdpTable<'a>
ethtool only.type Item = Result<TunnelUdpTable<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableWol<'a>
Available on crate feature ethtool only.
impl<'a> Iterator for IterableWol<'a>
ethtool only.Source§impl<'a> Iterator for IterableFou<'a>
Available on crate feature fou only.
impl<'a> Iterator for IterableFou<'a>
fou only.Source§impl<'a> Iterator for IterableAccept<'a>
Available on crate feature handshake only.
impl<'a> Iterator for IterableAccept<'a>
handshake only.Source§impl<'a> Iterator for IterableDone<'a>
Available on crate feature handshake only.
impl<'a> Iterator for IterableDone<'a>
handshake only.Source§impl<'a> Iterator for IterableX509<'a>
Available on crate feature handshake only.
impl<'a> Iterator for IterableX509<'a>
handshake only.Source§impl<'a> Iterator for IterableBpfStorage<'a>
Available on crate feature inet-diag only.
impl<'a> Iterator for IterableBpfStorage<'a>
inet-diag only.type Item = Result<BpfStorage<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableBpfStorageReply<'a>
Available on crate feature inet-diag only.
impl<'a> Iterator for IterableBpfStorageReply<'a>
inet-diag only.type Item = Result<BpfStorageReply<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableBpfStorageReq<'a>
Available on crate feature inet-diag only.
impl<'a> Iterator for IterableBpfStorageReq<'a>
inet-diag only.type Item = Result<BpfStorageReq, ErrorContext>
Source§impl<'a> Iterator for IterableReplyAttrs<'a>
Available on crate feature inet-diag only.
impl<'a> Iterator for IterableReplyAttrs<'a>
inet-diag only.type Item = Result<ReplyAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableRequestAttrs<'a>
Available on crate feature inet-diag only.
impl<'a> Iterator for IterableRequestAttrs<'a>
inet-diag only.type Item = Result<RequestAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableUlpInfoAttrs<'a>
Available on crate feature inet-diag only.
impl<'a> Iterator for IterableUlpInfoAttrs<'a>
inet-diag only.type Item = Result<UlpInfoAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for netlink_bindings::lockd::IterableServer<'a>
Available on crate feature lockd only.
impl<'a> Iterator for netlink_bindings::lockd::IterableServer<'a>
lockd only.Source§impl<'a> Iterator for IterableAddress<'a>
Available on crate feature mptcp_pm only.
impl<'a> Iterator for IterableAddress<'a>
mptcp_pm only.Source§impl<'a> Iterator for IterableAttr<'a>
Available on crate feature mptcp_pm only.
impl<'a> Iterator for IterableAttr<'a>
mptcp_pm only.Source§impl<'a> Iterator for IterableEndpoint<'a>
Available on crate feature mptcp_pm only.
impl<'a> Iterator for IterableEndpoint<'a>
mptcp_pm only.Source§impl<'a> Iterator for IterableEventAttr<'a>
Available on crate feature mptcp_pm only.
impl<'a> Iterator for IterableEventAttr<'a>
mptcp_pm only.Source§impl<'a> Iterator for IterableSubflowAttribute<'a>
Available on crate feature mptcp_pm only.
impl<'a> Iterator for IterableSubflowAttribute<'a>
mptcp_pm only.type Item = Result<SubflowAttribute<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCaps<'a>
Available on crate feature net-shaper only.
impl<'a> Iterator for IterableCaps<'a>
net-shaper only.Source§impl<'a> Iterator for IterableHandle<'a>
Available on crate feature net-shaper only.
impl<'a> Iterator for IterableHandle<'a>
net-shaper only.Source§impl<'a> Iterator for IterableLeafInfo<'a>
Available on crate feature net-shaper only.
impl<'a> Iterator for IterableLeafInfo<'a>
net-shaper only.Source§impl<'a> Iterator for IterableNetShaper<'a>
Available on crate feature net-shaper only.
impl<'a> Iterator for IterableNetShaper<'a>
net-shaper only.Source§impl<'a> Iterator for netlink_bindings::netdev::IterableDev<'a>
Available on crate feature netdev only.
impl<'a> Iterator for netlink_bindings::netdev::IterableDev<'a>
netdev only.Source§impl<'a> Iterator for IterableDmabuf<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterableDmabuf<'a>
netdev only.Source§impl<'a> Iterator for IterableIoUringProviderInfo<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterableIoUringProviderInfo<'a>
netdev only.type Item = Result<IoUringProviderInfo, ErrorContext>
Source§impl<'a> Iterator for IterableLease<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterableLease<'a>
netdev only.Source§impl<'a> Iterator for IterableNapi<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterableNapi<'a>
netdev only.Source§impl<'a> Iterator for IterablePagePool<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterablePagePool<'a>
netdev only.Source§impl<'a> Iterator for IterablePagePoolInfo<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterablePagePoolInfo<'a>
netdev only.type Item = Result<PagePoolInfo, ErrorContext>
Source§impl<'a> Iterator for IterablePagePoolStats<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterablePagePoolStats<'a>
netdev only.type Item = Result<PagePoolStats<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableQstats<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterableQstats<'a>
netdev only.Source§impl<'a> Iterator for IterableQueue<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterableQueue<'a>
netdev only.Source§impl<'a> Iterator for IterableQueueId<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterableQueueId<'a>
netdev only.Source§impl<'a> Iterator for IterableXskInfo<'a>
Available on crate feature netdev only.
impl<'a> Iterator for IterableXskInfo<'a>
netdev only.Source§impl<'a> Iterator for IterablePoolMode<'a>
Available on crate feature nfsd only.
impl<'a> Iterator for IterablePoolMode<'a>
nfsd only.Source§impl<'a> Iterator for IterableRpcStatus<'a>
Available on crate feature nfsd only.
impl<'a> Iterator for IterableRpcStatus<'a>
nfsd only.Source§impl<'a> Iterator for netlink_bindings::nfsd::IterableServer<'a>
Available on crate feature nfsd only.
impl<'a> Iterator for netlink_bindings::nfsd::IterableServer<'a>
nfsd only.Source§impl<'a> Iterator for IterableServerProto<'a>
Available on crate feature nfsd only.
impl<'a> Iterator for IterableServerProto<'a>
nfsd only.type Item = Result<ServerProto<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableServerSock<'a>
Available on crate feature nfsd only.
impl<'a> Iterator for IterableServerSock<'a>
nfsd only.type Item = Result<ServerSock<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSock<'a>
Available on crate feature nfsd only.
impl<'a> Iterator for IterableSock<'a>
nfsd only.Source§impl<'a> Iterator for IterableVersion<'a>
Available on crate feature nfsd only.
impl<'a> Iterator for IterableVersion<'a>
nfsd only.Source§impl<'a> Iterator for IterableBatchAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableBatchAttrs<'a>
nftables only.type Item = Result<BatchAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableChainAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableChainAttrs<'a>
nftables only.type Item = Result<ChainAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCompatAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableCompatAttrs<'a>
nftables only.type Item = Result<CompatAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCompatMatchAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableCompatMatchAttrs<'a>
nftables only.type Item = Result<CompatMatchAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCompatTargetAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableCompatTargetAttrs<'a>
nftables only.type Item = Result<CompatTargetAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for netlink_bindings::nftables::IterableCounterAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for netlink_bindings::nftables::IterableCounterAttrs<'a>
nftables only.type Item = Result<CounterAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDataAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableDataAttrs<'a>
nftables only.Source§impl<'a> Iterator for IterableExprAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprAttrs<'a>
nftables only.Source§impl<'a> Iterator for IterableExprBitwiseAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprBitwiseAttrs<'a>
nftables only.type Item = Result<ExprBitwiseAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableExprCmpAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprCmpAttrs<'a>
nftables only.type Item = Result<ExprCmpAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableExprCounterAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprCounterAttrs<'a>
nftables only.type Item = Result<ExprCounterAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableExprCtAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprCtAttrs<'a>
nftables only.type Item = Result<ExprCtAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableExprFibAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprFibAttrs<'a>
nftables only.type Item = Result<ExprFibAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableExprFlowOffloadAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprFlowOffloadAttrs<'a>
nftables only.type Item = Result<ExprFlowOffloadAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableExprImmediateAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprImmediateAttrs<'a>
nftables only.type Item = Result<ExprImmediateAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableExprListAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprListAttrs<'a>
nftables only.type Item = Result<ExprListAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableExprLookupAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprLookupAttrs<'a>
nftables only.type Item = Result<ExprLookupAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableExprMasqAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprMasqAttrs<'a>
nftables only.type Item = Result<ExprMasqAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableExprMetaAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprMetaAttrs<'a>
nftables only.type Item = Result<ExprMetaAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableExprNatAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprNatAttrs<'a>
nftables only.type Item = Result<ExprNatAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableExprObjrefAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprObjrefAttrs<'a>
nftables only.type Item = Result<ExprObjrefAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableExprPayloadAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprPayloadAttrs<'a>
nftables only.type Item = Result<ExprPayloadAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableExprRejectAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprRejectAttrs<'a>
nftables only.type Item = Result<ExprRejectAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableExprTargetAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprTargetAttrs<'a>
nftables only.type Item = Result<ExprTargetAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableExprTproxyAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableExprTproxyAttrs<'a>
nftables only.type Item = Result<ExprTproxyAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableFlowtableAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableFlowtableAttrs<'a>
nftables only.type Item = Result<FlowtableAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableFlowtableHookAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableFlowtableHookAttrs<'a>
nftables only.type Item = Result<FlowtableHookAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableGenAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableGenAttrs<'a>
nftables only.Source§impl<'a> Iterator for IterableHookDevAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableHookDevAttrs<'a>
nftables only.type Item = Result<HookDevAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLogAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableLogAttrs<'a>
nftables only.Source§impl<'a> Iterator for IterableNftCounterAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableNftCounterAttrs<'a>
nftables only.type Item = Result<NftCounterAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableNftHookAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableNftHookAttrs<'a>
nftables only.type Item = Result<NftHookAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableNumgenAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableNumgenAttrs<'a>
nftables only.type Item = Result<NumgenAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableObjAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableObjAttrs<'a>
nftables only.Source§impl<'a> Iterator for IterableQuotaAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableQuotaAttrs<'a>
nftables only.type Item = Result<QuotaAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableRangeAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableRangeAttrs<'a>
nftables only.type Item = Result<RangeAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableRuleAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableRuleAttrs<'a>
nftables only.Source§impl<'a> Iterator for IterableRuleCompatAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableRuleCompatAttrs<'a>
nftables only.type Item = Result<RuleCompatAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableSetAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableSetAttrs<'a>
nftables only.Source§impl<'a> Iterator for IterableSetDescAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableSetDescAttrs<'a>
nftables only.type Item = Result<SetDescAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSetDescConcatAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableSetDescConcatAttrs<'a>
nftables only.type Item = Result<SetDescConcatAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSetFieldAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableSetFieldAttrs<'a>
nftables only.type Item = Result<SetFieldAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableSetListAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableSetListAttrs<'a>
nftables only.type Item = Result<SetListAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSetelemAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableSetelemAttrs<'a>
nftables only.type Item = Result<SetelemAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSetelemListAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableSetelemListAttrs<'a>
nftables only.type Item = Result<SetelemListAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSetelemListElemAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableSetelemListElemAttrs<'a>
nftables only.type Item = Result<SetelemListElemAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTableAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableTableAttrs<'a>
nftables only.type Item = Result<TableAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableVerdictAttrs<'a>
Available on crate feature nftables only.
impl<'a> Iterator for IterableVerdictAttrs<'a>
nftables only.type Item = Result<VerdictAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayBitrateAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableArrayBitrateAttrs<'a>
nl80211 only.type Item = Result<IterableBitrateAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayFrequencyAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableArrayFrequencyAttrs<'a>
nl80211 only.type Item = Result<IterableFrequencyAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayIfCombinationAttributes<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableArrayIfCombinationAttributes<'a>
nl80211 only.type Item = Result<IterableIfCombinationAttributes<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayIfaceLimitAttributes<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableArrayIfaceLimitAttributes<'a>
nl80211 only.type Item = Result<IterableIfaceLimitAttributes<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayIftypeDataAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableArrayIftypeDataAttrs<'a>
nl80211 only.type Item = Result<IterableIftypeDataAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArraySarSpecs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableArraySarSpecs<'a>
nl80211 only.type Item = Result<IterableSarSpecs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayU32<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableArrayU32<'a>
nl80211 only.Source§impl<'a> Iterator for IterableArrayWmmAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableArrayWmmAttrs<'a>
nl80211 only.type Item = Result<IterableWmmAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableBandAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableBandAttrs<'a>
nl80211 only.Source§impl<'a> Iterator for IterableBitrateAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableBitrateAttrs<'a>
nl80211 only.type Item = Result<BitrateAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableFrameTypeAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableFrameTypeAttrs<'a>
nl80211 only.type Item = Result<FrameTypeAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableFrequencyAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableFrequencyAttrs<'a>
nl80211 only.type Item = Result<FrequencyAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableIfCombinationAttributes<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableIfCombinationAttributes<'a>
nl80211 only.type Item = Result<IfCombinationAttributes<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableIfaceLimitAttributes<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableIfaceLimitAttributes<'a>
nl80211 only.type Item = Result<IfaceLimitAttributes<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableIftypeAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableIftypeAttrs<'a>
nl80211 only.type Item = Result<IftypeAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableIftypeDataAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableIftypeDataAttrs<'a>
nl80211 only.type Item = Result<IftypeDataAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableNl80211Attrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableNl80211Attrs<'a>
nl80211 only.type Item = Result<Nl80211Attrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSarAttributes<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableSarAttributes<'a>
nl80211 only.type Item = Result<SarAttributes<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSarSpecs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableSarSpecs<'a>
nl80211 only.Source§impl<'a> Iterator for IterableSupportedIftypes<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableSupportedIftypes<'a>
nl80211 only.type Item = Result<SupportedIftypes, ErrorContext>
Source§impl<'a> Iterator for IterableTxqStatsAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableTxqStatsAttrs<'a>
nl80211 only.type Item = Result<TxqStatsAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableWiphyBands<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableWiphyBands<'a>
nl80211 only.type Item = Result<WiphyBands<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableWmmAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableWmmAttrs<'a>
nl80211 only.Source§impl<'a> Iterator for IterableWowlanTriggersAttrs<'a>
Available on crate feature nl80211 only.
impl<'a> Iterator for IterableWowlanTriggersAttrs<'a>
nl80211 only.type Item = Result<WowlanTriggersAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableArrayMcastGroupAttrs<'a>
Available on crate feature nlctrl only.
impl<'a> Iterator for IterableArrayMcastGroupAttrs<'a>
nlctrl only.type Item = Result<IterableMcastGroupAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayOpAttrs<'a>
Available on crate feature nlctrl only.
impl<'a> Iterator for IterableArrayOpAttrs<'a>
nlctrl only.type Item = Result<IterableOpAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCtrlAttrs<'a>
Available on crate feature nlctrl only.
impl<'a> Iterator for IterableCtrlAttrs<'a>
nlctrl only.Source§impl<'a> Iterator for IterableMcastGroupAttrs<'a>
Available on crate feature nlctrl only.
impl<'a> Iterator for IterableMcastGroupAttrs<'a>
nlctrl only.type Item = Result<McastGroupAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableOpAttrs<'a>
Available on crate feature nlctrl only.
impl<'a> Iterator for IterableOpAttrs<'a>
nlctrl only.Source§impl<'a> Iterator for IterableOpPolicyAttrs<'a>
Available on crate feature nlctrl only.
impl<'a> Iterator for IterableOpPolicyAttrs<'a>
nlctrl only.type Item = Result<OpPolicyAttrs, ErrorContext>
Source§impl<'a> Iterator for IterablePolicyAttrs<'a>
Available on crate feature nlctrl only.
impl<'a> Iterator for IterablePolicyAttrs<'a>
nlctrl only.type Item = Result<PolicyAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableKeyconf<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableKeyconf<'a>
ovpn only.Source§impl<'a> Iterator for IterableKeyconfDelInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableKeyconfDelInput<'a>
ovpn only.type Item = Result<KeyconfDelInput, ErrorContext>
Source§impl<'a> Iterator for IterableKeyconfGet<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableKeyconfGet<'a>
ovpn only.type Item = Result<KeyconfGet, ErrorContext>
Source§impl<'a> Iterator for IterableKeyconfSwapInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableKeyconfSwapInput<'a>
ovpn only.type Item = Result<KeyconfSwapInput, ErrorContext>
Source§impl<'a> Iterator for IterableKeydir<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableKeydir<'a>
ovpn only.Source§impl<'a> Iterator for IterableOvpn<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableOvpn<'a>
ovpn only.Source§impl<'a> Iterator for IterableOvpnKeyconfDelInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableOvpnKeyconfDelInput<'a>
ovpn only.type Item = Result<OvpnKeyconfDelInput<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableOvpnKeyconfGet<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableOvpnKeyconfGet<'a>
ovpn only.type Item = Result<OvpnKeyconfGet<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableOvpnKeyconfSwapInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableOvpnKeyconfSwapInput<'a>
ovpn only.type Item = Result<OvpnKeyconfSwapInput<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableOvpnPeerDelInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableOvpnPeerDelInput<'a>
ovpn only.type Item = Result<OvpnPeerDelInput<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableOvpnPeerNewInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableOvpnPeerNewInput<'a>
ovpn only.type Item = Result<OvpnPeerNewInput<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableOvpnPeerSetInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterableOvpnPeerSetInput<'a>
ovpn only.type Item = Result<OvpnPeerSetInput<'a>, ErrorContext>
Source§impl<'a> Iterator for IterablePeer<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterablePeer<'a>
ovpn only.Source§impl<'a> Iterator for IterablePeerDelInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterablePeerDelInput<'a>
ovpn only.type Item = Result<PeerDelInput, ErrorContext>
Source§impl<'a> Iterator for IterablePeerNewInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterablePeerNewInput<'a>
ovpn only.type Item = Result<PeerNewInput<'a>, ErrorContext>
Source§impl<'a> Iterator for IterablePeerSetInput<'a>
Available on crate feature ovpn only.
impl<'a> Iterator for IterablePeerSetInput<'a>
ovpn only.type Item = Result<PeerSetInput<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableDatapath<'a>
Available on crate feature ovs_datapath only.
impl<'a> Iterator for IterableDatapath<'a>
ovs_datapath only.Source§impl<'a> Iterator for IterableActionAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableActionAttrs<'a>
ovs_flow only.type Item = Result<ActionAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCheckPktLenAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableCheckPktLenAttrs<'a>
ovs_flow only.type Item = Result<CheckPktLenAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCtAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableCtAttrs<'a>
ovs_flow only.Source§impl<'a> Iterator for IterableDecTtlAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableDecTtlAttrs<'a>
ovs_flow only.type Item = Result<DecTtlAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for netlink_bindings::ovs_flow::IterableFlowAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for netlink_bindings::ovs_flow::IterableFlowAttrs<'a>
ovs_flow only.Source§impl<'a> Iterator for IterableKeyAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableKeyAttrs<'a>
ovs_flow only.Source§impl<'a> Iterator for netlink_bindings::ovs_flow::IterableNatAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for netlink_bindings::ovs_flow::IterableNatAttrs<'a>
ovs_flow only.Source§impl<'a> Iterator for IterableOvsNshKeyAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableOvsNshKeyAttrs<'a>
ovs_flow only.type Item = Result<OvsNshKeyAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterablePsampleAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterablePsampleAttrs<'a>
ovs_flow only.type Item = Result<PsampleAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableSampleAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableSampleAttrs<'a>
ovs_flow only.type Item = Result<SampleAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTunnelKeyAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableTunnelKeyAttrs<'a>
ovs_flow only.type Item = Result<TunnelKeyAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableUserspaceAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableUserspaceAttrs<'a>
ovs_flow only.type Item = Result<UserspaceAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableVxlanExtAttrs<'a>
Available on crate feature ovs_flow only.
impl<'a> Iterator for IterableVxlanExtAttrs<'a>
ovs_flow only.type Item = Result<VxlanExtAttrs, ErrorContext>
Source§impl<'a> Iterator for IterablePacket<'a>
Available on crate feature ovs_packet only.
impl<'a> Iterator for IterablePacket<'a>
ovs_packet only.Source§impl<'a> Iterator for IterableUpcallStats<'a>
Available on crate feature ovs_vport only.
impl<'a> Iterator for IterableUpcallStats<'a>
ovs_vport only.type Item = Result<UpcallStats, ErrorContext>
Source§impl<'a> Iterator for IterableVport<'a>
Available on crate feature ovs_vport only.
impl<'a> Iterator for IterableVport<'a>
ovs_vport only.Source§impl<'a> Iterator for IterableVportOptions<'a>
Available on crate feature ovs_vport only.
impl<'a> Iterator for IterableVportOptions<'a>
ovs_vport only.type Item = Result<VportOptions, ErrorContext>
Source§impl<'a> Iterator for IterableAssoc<'a>
Available on crate feature psp only.
impl<'a> Iterator for IterableAssoc<'a>
psp only.Source§impl<'a> Iterator for netlink_bindings::psp::IterableDev<'a>
Available on crate feature psp only.
impl<'a> Iterator for netlink_bindings::psp::IterableDev<'a>
psp only.Source§impl<'a> Iterator for IterableKeys<'a>
Available on crate feature psp only.
impl<'a> Iterator for IterableKeys<'a>
psp only.Source§impl<'a> Iterator for netlink_bindings::psp::IterableStats<'a>
Available on crate feature psp only.
impl<'a> Iterator for netlink_bindings::psp::IterableStats<'a>
psp only.Source§impl<'a> Iterator for IterableAddrAttrs<'a>
Available on crate feature rt-addr only.
impl<'a> Iterator for IterableAddrAttrs<'a>
rt-addr only.Source§impl<'a> Iterator for IterableAfSpecAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableAfSpecAttrs<'a>
rt-link only.type Item = Result<AfSpecAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayBinary<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableArrayBinary<'a>
rt-link only.Source§impl<'a> Iterator for IterableArrayHwSInfoOne<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableArrayHwSInfoOne<'a>
rt-link only.type Item = Result<IterableHwSInfoOne<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayIpv4Addr<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableArrayIpv4Addr<'a>
rt-link only.Source§impl<'a> Iterator for IterableBondAdInfoAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableBondAdInfoAttrs<'a>
rt-link only.type Item = Result<BondAdInfoAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableBondSlaveAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableBondSlaveAttrs<'a>
rt-link only.type Item = Result<BondSlaveAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableHwSInfoOne<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableHwSInfoOne<'a>
rt-link only.type Item = Result<HwSInfoOne, ErrorContext>
Source§impl<'a> Iterator for IterableIfla6Attrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableIfla6Attrs<'a>
rt-link only.type Item = Result<Ifla6Attrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableIflaAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableIflaAttrs<'a>
rt-link only.Source§impl<'a> Iterator for IterableIflaVlanQos<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableIflaVlanQos<'a>
rt-link only.type Item = Result<IflaVlanQos, ErrorContext>
Source§impl<'a> Iterator for IterableLinkAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkAttrs<'a>
rt-link only.Source§impl<'a> Iterator for IterableLinkDpllPinAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkDpllPinAttrs<'a>
rt-link only.type Item = Result<LinkDpllPinAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableLinkOffloadXstats<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkOffloadXstats<'a>
rt-link only.type Item = Result<LinkOffloadXstats<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoAttrs<'a>
rt-link only.type Item = Result<LinkinfoAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoBondAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoBondAttrs<'a>
rt-link only.type Item = Result<LinkinfoBondAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoBridgeAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoBridgeAttrs<'a>
rt-link only.type Item = Result<LinkinfoBridgeAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoBrportAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoBrportAttrs<'a>
rt-link only.type Item = Result<LinkinfoBrportAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoGeneveAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoGeneveAttrs<'a>
rt-link only.type Item = Result<LinkinfoGeneveAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoGre6Attrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoGre6Attrs<'a>
rt-link only.type Item = Result<LinkinfoGre6Attrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoGreAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoGreAttrs<'a>
rt-link only.type Item = Result<LinkinfoGreAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoHsrAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoHsrAttrs<'a>
rt-link only.type Item = Result<LinkinfoHsrAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoIp6tnlAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoIp6tnlAttrs<'a>
rt-link only.type Item = Result<LinkinfoIp6tnlAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoIptunAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoIptunAttrs<'a>
rt-link only.type Item = Result<LinkinfoIptunAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoNetkitAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoNetkitAttrs<'a>
rt-link only.type Item = Result<LinkinfoNetkitAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoOvpnAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoOvpnAttrs<'a>
rt-link only.type Item = Result<LinkinfoOvpnAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoTunAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoTunAttrs<'a>
rt-link only.type Item = Result<LinkinfoTunAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoVlanAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoVlanAttrs<'a>
rt-link only.type Item = Result<LinkinfoVlanAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoVrfAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoVrfAttrs<'a>
rt-link only.type Item = Result<LinkinfoVrfAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoVti6Attrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoVti6Attrs<'a>
rt-link only.type Item = Result<LinkinfoVti6Attrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableLinkinfoVtiAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableLinkinfoVtiAttrs<'a>
rt-link only.type Item = Result<LinkinfoVtiAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableMctpAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableMctpAttrs<'a>
rt-link only.Source§impl<'a> Iterator for IterablePortSelfAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterablePortSelfAttrs<'a>
rt-link only.type Item = Result<PortSelfAttrs, ErrorContext>
Source§impl<'a> Iterator for IterablePropListLinkAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterablePropListLinkAttrs<'a>
rt-link only.type Item = Result<PropListLinkAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableStatsAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableStatsAttrs<'a>
rt-link only.type Item = Result<StatsAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableVfPortsAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableVfPortsAttrs<'a>
rt-link only.type Item = Result<VfPortsAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableVfStatsAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableVfStatsAttrs<'a>
rt-link only.type Item = Result<VfStatsAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableVfVlanAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableVfVlanAttrs<'a>
rt-link only.type Item = Result<VfVlanAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableVfinfoAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableVfinfoAttrs<'a>
rt-link only.type Item = Result<VfinfoAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableVfinfoListAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableVfinfoListAttrs<'a>
rt-link only.type Item = Result<VfinfoListAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableXdpAttrs<'a>
Available on crate feature rt-link only.
impl<'a> Iterator for IterableXdpAttrs<'a>
rt-link only.Source§impl<'a> Iterator for IterableNdtAttrs<'a>
Available on crate feature rt-neigh only.
impl<'a> Iterator for IterableNdtAttrs<'a>
rt-neigh only.Source§impl<'a> Iterator for IterableNdtpaAttrs<'a>
Available on crate feature rt-neigh only.
impl<'a> Iterator for IterableNdtpaAttrs<'a>
rt-neigh only.type Item = Result<NdtpaAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableNeighbourAttrs<'a>
Available on crate feature rt-neigh only.
impl<'a> Iterator for IterableNeighbourAttrs<'a>
rt-neigh only.type Item = Result<NeighbourAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for netlink_bindings::rt_route::IterableMetrics<'a>
Available on crate feature rt-route only.
impl<'a> Iterator for netlink_bindings::rt_route::IterableMetrics<'a>
rt-route only.Source§impl<'a> Iterator for netlink_bindings::rt_route::IterableRouteAttrs<'a>
Available on crate feature rt-route only.
impl<'a> Iterator for netlink_bindings::rt_route::IterableRouteAttrs<'a>
rt-route only.type Item = Result<RouteAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableFibRuleAttrs<'a>
Available on crate feature rt-rule only.
impl<'a> Iterator for IterableFibRuleAttrs<'a>
rt-rule only.type Item = Result<FibRuleAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableActBpfAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActBpfAttrs<'a>
tc only.type Item = Result<ActBpfAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActConnmarkAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActConnmarkAttrs<'a>
tc only.type Item = Result<ActConnmarkAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActCsumAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActCsumAttrs<'a>
tc only.type Item = Result<ActCsumAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActCtAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActCtAttrs<'a>
tc only.type Item = Result<ActCtAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActCtinfoAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActCtinfoAttrs<'a>
tc only.type Item = Result<ActCtinfoAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActGactAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActGactAttrs<'a>
tc only.type Item = Result<ActGactAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActGateAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActGateAttrs<'a>
tc only.type Item = Result<ActGateAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActIfeAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActIfeAttrs<'a>
tc only.type Item = Result<ActIfeAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActMirredAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActMirredAttrs<'a>
tc only.type Item = Result<ActMirredAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActMplsAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActMplsAttrs<'a>
tc only.type Item = Result<ActMplsAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActNatAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActNatAttrs<'a>
tc only.type Item = Result<ActNatAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActPeditAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActPeditAttrs<'a>
tc only.type Item = Result<ActPeditAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActSampleAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActSampleAttrs<'a>
tc only.type Item = Result<ActSampleAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActSimpleAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActSimpleAttrs<'a>
tc only.type Item = Result<ActSimpleAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActSkbeditAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActSkbeditAttrs<'a>
tc only.type Item = Result<ActSkbeditAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActSkbmodAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActSkbmodAttrs<'a>
tc only.type Item = Result<ActSkbmodAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActTunnelKeyAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActTunnelKeyAttrs<'a>
tc only.type Item = Result<ActTunnelKeyAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableActVlanAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableActVlanAttrs<'a>
tc only.type Item = Result<ActVlanAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayActAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableArrayActAttrs<'a>
tc only.type Item = Result<IterableActAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayCakeTinStatsAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableArrayCakeTinStatsAttrs<'a>
tc only.type Item = Result<IterableCakeTinStatsAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableBasicAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableBasicAttrs<'a>
tc only.type Item = Result<BasicAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableBpfAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableBpfAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableCakeAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableCakeAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableCakeStatsAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableCakeStatsAttrs<'a>
tc only.type Item = Result<CakeStatsAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCakeTinStatsAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableCakeTinStatsAttrs<'a>
tc only.type Item = Result<CakeTinStatsAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCbsAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableCbsAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableCgroupAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableCgroupAttrs<'a>
tc only.type Item = Result<CgroupAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableChokeAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableChokeAttrs<'a>
tc only.type Item = Result<ChokeAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableCodelAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableCodelAttrs<'a>
tc only.type Item = Result<CodelAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableDrrAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableDrrAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableDualpi2Attrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableDualpi2Attrs<'a>
tc only.type Item = Result<Dualpi2Attrs, ErrorContext>
Source§impl<'a> Iterator for IterableEmatchAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableEmatchAttrs<'a>
tc only.type Item = Result<EmatchAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableEtfAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableEtfAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableEtsAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableEtsAttrs<'a>
tc only.Source§impl<'a> Iterator for netlink_bindings::tc::IterableFlowAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for netlink_bindings::tc::IterableFlowAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableFlowerAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFlowerAttrs<'a>
tc only.type Item = Result<FlowerAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableFlowerKeyCfmAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFlowerKeyCfmAttrs<'a>
tc only.type Item = Result<FlowerKeyCfmAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableFlowerKeyEncOptErspanAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFlowerKeyEncOptErspanAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableFlowerKeyEncOptGeneveAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFlowerKeyEncOptGeneveAttrs<'a>
tc only.type Item = Result<FlowerKeyEncOptGeneveAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableFlowerKeyEncOptGtpAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFlowerKeyEncOptGtpAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableFlowerKeyEncOptVxlanAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFlowerKeyEncOptVxlanAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableFlowerKeyEncOptsAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFlowerKeyEncOptsAttrs<'a>
tc only.type Item = Result<FlowerKeyEncOptsAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableFlowerKeyMplsOptAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFlowerKeyMplsOptAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableFqAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFqAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableFqCodelAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFqCodelAttrs<'a>
tc only.type Item = Result<FqCodelAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableFqPieAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFqPieAttrs<'a>
tc only.type Item = Result<FqPieAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableFwAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableFwAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableGredAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableGredAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableHfscAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableHfscAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableHhfAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableHhfAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableHtbAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableHtbAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableMatchallAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableMatchallAttrs<'a>
tc only.type Item = Result<MatchallAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableNetemAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableNetemAttrs<'a>
tc only.type Item = Result<NetemAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableNetemLossAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableNetemLossAttrs<'a>
tc only.type Item = Result<NetemLossAttrs, ErrorContext>
Source§impl<'a> Iterator for IterablePieAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterablePieAttrs<'a>
tc only.Source§impl<'a> Iterator for IterablePoliceAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterablePoliceAttrs<'a>
tc only.type Item = Result<PoliceAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableQfqAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableQfqAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableRedAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableRedAttrs<'a>
tc only.Source§impl<'a> Iterator for netlink_bindings::tc::IterableRouteAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for netlink_bindings::tc::IterableRouteAttrs<'a>
tc only.type Item = Result<RouteAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTaprioAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableTaprioAttrs<'a>
tc only.type Item = Result<TaprioAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTaprioSchedEntry<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableTaprioSchedEntry<'a>
tc only.type Item = Result<TaprioSchedEntry, ErrorContext>
Source§impl<'a> Iterator for IterableTaprioSchedEntryList<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableTaprioSchedEntryList<'a>
tc only.type Item = Result<TaprioSchedEntryList<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTaprioTcEntryAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableTaprioTcEntryAttrs<'a>
tc only.type Item = Result<TaprioTcEntryAttrs, ErrorContext>
Source§impl<'a> Iterator for IterableTbfAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableTbfAttrs<'a>
tc only.Source§impl<'a> Iterator for IterableTcaGredVqEntryAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableTcaGredVqEntryAttrs<'a>
tc only.type Item = Result<TcaGredVqEntryAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTcaGredVqListAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableTcaGredVqListAttrs<'a>
tc only.type Item = Result<TcaGredVqListAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTcaStabAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableTcaStabAttrs<'a>
tc only.type Item = Result<TcaStabAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableTcaStatsAttrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableTcaStatsAttrs<'a>
tc only.type Item = Result<TcaStatsAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableU32Attrs<'a>
Available on crate feature tc only.
impl<'a> Iterator for IterableU32Attrs<'a>
tc only.Source§impl<'a> Iterator for netlink_bindings::tcp_metrics::IterableMetrics<'a>
Available on crate feature tcp_metrics only.
impl<'a> Iterator for netlink_bindings::tcp_metrics::IterableMetrics<'a>
tcp_metrics only.Source§impl<'a> Iterator for IterableTcpMetrics<'a>
Available on crate feature tcp_metrics only.
impl<'a> Iterator for IterableTcpMetrics<'a>
tcp_metrics only.type Item = Result<TcpMetrics<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableAttrOption<'a>
Available on crate feature team only.
impl<'a> Iterator for IterableAttrOption<'a>
team only.type Item = Result<AttrOption<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableAttrPort<'a>
Available on crate feature team only.
impl<'a> Iterator for IterableAttrPort<'a>
team only.Source§impl<'a> Iterator for IterableItemOption<'a>
Available on crate feature team only.
impl<'a> Iterator for IterableItemOption<'a>
team only.type Item = Result<ItemOption<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableItemPort<'a>
Available on crate feature team only.
impl<'a> Iterator for IterableItemPort<'a>
team only.Source§impl<'a> Iterator for IterableTeam<'a>
Available on crate feature team only.
impl<'a> Iterator for IterableTeam<'a>
team only.Source§impl<'a> Iterator for IterableUnixDiagAttrs<'a>
Available on crate feature unix-diag only.
impl<'a> Iterator for IterableUnixDiagAttrs<'a>
unix-diag only.type Item = Result<UnixDiagAttrs<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayWgallowedip<'a>
Available on crate feature wireguard only.
impl<'a> Iterator for IterableArrayWgallowedip<'a>
wireguard only.type Item = Result<IterableWgallowedip<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableArrayWgpeer<'a>
Available on crate feature wireguard only.
impl<'a> Iterator for IterableArrayWgpeer<'a>
wireguard only.type Item = Result<IterableWgpeer<'a>, ErrorContext>
Source§impl<'a> Iterator for IterableWgallowedip<'a>
Available on crate feature wireguard only.
impl<'a> Iterator for IterableWgallowedip<'a>
wireguard only.type Item = Result<Wgallowedip, ErrorContext>
Source§impl<'a> Iterator for IterableWgdevice<'a>
Available on crate feature wireguard only.
impl<'a> Iterator for IterableWgdevice<'a>
wireguard only.Source§impl<'a> Iterator for IterableWgpeer<'a>
Available on crate feature wireguard only.
impl<'a> Iterator for IterableWgpeer<'a>
wireguard only.Source§impl<'a> Iterator for Messages<'a>
impl<'a> Iterator for Messages<'a>
type Item = Result<AncillaryData<'a>, AncillaryError>
Source§impl<'a> Iterator for ScmCredentials<'a>
Available on Android or Cygwin or FreeBSD or Linux or NetBSD only.
impl<'a> Iterator for ScmCredentials<'a>
type Item = SocketCred
1.57.0 · Source§impl<'a> Iterator for CommandEnvs<'a>
impl<'a> Iterator for CommandEnvs<'a>
1.0.0 · Source§impl<'a, K, A> Iterator for std::collections::hash::set::Drain<'a, K, A>where
A: Allocator,
impl<'a, K, A> Iterator for std::collections::hash::set::Drain<'a, K, A>where
A: Allocator,
1.0.0 · Source§impl<'a, K, V> Iterator for alloc::collections::btree::map::Iter<'a, K, V>where
K: 'a,
V: 'a,
impl<'a, K, V> Iterator for alloc::collections::btree::map::Iter<'a, K, V>where
K: 'a,
V: 'a,
1.6.0 · Source§impl<'a, K, V, A> Iterator for std::collections::hash::map::Drain<'a, K, V, A>where
A: Allocator,
impl<'a, K, V, A> Iterator for std::collections::hash::map::Drain<'a, K, V, A>where
A: Allocator,
1.5.0 · Source§impl<'a, P> Iterator for MatchIndices<'a, P>where
P: Pattern,
impl<'a, P> Iterator for MatchIndices<'a, P>where
P: Pattern,
1.5.0 · Source§impl<'a, P> Iterator for RMatchIndices<'a, P>
impl<'a, P> Iterator for RMatchIndices<'a, P>
1.0.0 · Source§impl<'a, P> Iterator for RSplitTerminator<'a, P>
impl<'a, P> Iterator for RSplitTerminator<'a, P>
1.51.0 · Source§impl<'a, P> Iterator for core::str::iter::SplitInclusive<'a, P>where
P: Pattern,
impl<'a, P> Iterator for core::str::iter::SplitInclusive<'a, P>where
P: Pattern,
1.0.0 · Source§impl<'a, P> Iterator for SplitTerminator<'a, P>where
P: Pattern,
impl<'a, P> Iterator for SplitTerminator<'a, P>where
P: Pattern,
1.0.0 · Source§impl<'a, T> Iterator for alloc::collections::btree::set::SymmetricDifference<'a, T>where
T: Ord,
impl<'a, T> Iterator for alloc::collections::btree::set::SymmetricDifference<'a, T>where
T: Ord,
1.0.0 · Source§impl<'a, T, A> Iterator for alloc::collections::btree::set::Difference<'a, T, A>
impl<'a, T, A> Iterator for alloc::collections::btree::set::Difference<'a, T, A>
1.0.0 · Source§impl<'a, T, A> Iterator for alloc::collections::btree::set::Intersection<'a, T, A>
impl<'a, T, A> Iterator for alloc::collections::btree::set::Intersection<'a, T, A>
1.77.0 · Source§impl<'a, T, P> Iterator for ChunkByMut<'a, T, P>
impl<'a, T, P> Iterator for ChunkByMut<'a, T, P>
1.0.0 · Source§impl<'a, T, P> Iterator for RSplitNMut<'a, T, P>
impl<'a, T, P> Iterator for RSplitNMut<'a, T, P>
1.51.0 · Source§impl<'a, T, P> Iterator for core::slice::iter::SplitInclusive<'a, T, P>
impl<'a, T, P> Iterator for core::slice::iter::SplitInclusive<'a, T, P>
1.51.0 · Source§impl<'a, T, P> Iterator for SplitInclusiveMut<'a, T, P>
impl<'a, T, P> Iterator for SplitInclusiveMut<'a, T, P>
1.0.0 · Source§impl<'a, T, S, A> Iterator for std::collections::hash::set::Difference<'a, T, S, A>
impl<'a, T, S, A> Iterator for std::collections::hash::set::Difference<'a, T, S, A>
1.0.0 · Source§impl<'a, T, S, A> Iterator for std::collections::hash::set::Intersection<'a, T, S, A>
impl<'a, T, S, A> Iterator for std::collections::hash::set::Intersection<'a, T, S, A>
1.0.0 · Source§impl<'a, T, S, A> Iterator for std::collections::hash::set::SymmetricDifference<'a, T, S, A>
impl<'a, T, S, A> Iterator for std::collections::hash::set::SymmetricDifference<'a, T, S, A>
1.94.0 · Source§impl<'a, T, const N: usize> Iterator for ArrayWindows<'a, T, N>
impl<'a, T, const N: usize> Iterator for ArrayWindows<'a, T, N>
Source§impl<A> Iterator for OptionFlatten<A>where
A: Iterator,
impl<A> Iterator for OptionFlatten<A>where
A: Iterator,
Source§impl<G> Iterator for FromCoroutine<G>
impl<G> Iterator for FromCoroutine<G>
1.0.0 · Source§impl<I> Iterator for &mut I
Implements Iterator for mutable references to iterators, such as those produced by Iterator::by_ref.
impl<I> Iterator for &mut I
Implements Iterator for mutable references to iterators, such as those produced by Iterator::by_ref.
This implementation passes all method calls on to the original iterator.