Skip to main content

Iter

Struct Iter 

1.0.0 · Source
pub struct Iter<'a, T>
where T: 'a,
{ /* private fields */ }
Expand description

An iterator over the elements of a BinaryHeap.

This struct is created by BinaryHeap::iter(). See its documentation for more.

Trait Implementations§

1.0.0 · Source§

impl<T> Clone for Iter<'_, T>

Source§

fn clone(&self) -> Iter<'_, T> ⓘ

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
1.17.0 · Source§

impl<T> Debug for Iter<'_, T>
where T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
1.82.0 · Source§

impl<T> Default for Iter<'_, T>

Source§

fn default() -> Iter<'_, T> ⓘ

Creates an empty binary_heap::Iter.

let iter: binary_heap::Iter<'_, u8> = Default::default();
assert_eq!(iter.len(), 0);
1.0.0 · Source§

impl<'a, T> DoubleEndedIterator for Iter<'a, T>

Source§

fn next_back(&mut self) -> Option<&'a T>

Removes and returns an element from the end of the iterator. Read more
Source§

fn next_chunk_back<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 #98326)
Advances from the back of the iterator and returns an array containing the next N values in sequence. Read more
Source§

fn advance_back_by(&mut self, n: usize) -> Result<(), NonZero<usize>>

🔬This is a nightly-only experimental API. (iter_advance_by #77404)
Advances the iterator from the back by n elements. Read more
1.37.0 (const: unstable) · Source§

fn nth_back(&mut self, n: usize) -> Option<Self::Item>

Returns the nth element from the end of the iterator. Read more
1.27.0 (const: unstable) · Source§

fn try_rfold<B, F, R>(&mut self, init: B, f: F) -> R
where Self: Sized, F: FnMut(B, Self::Item) -> R, R: Try<Output = B>,

This is the reverse version of Iterator::try_fold(): it takes elements starting from the back of the iterator. Read more
1.27.0 (const: unstable) · Source§

fn rfold<B, F>(self, init: B, f: F) -> B
where Self: Sized, F: FnMut(B, Self::Item) -> B,

An iterator method that reduces the iterator’s elements to a single, final value, starting from the back. Read more
1.27.0 (const: unstable) · Source§

fn rfind<P>(&mut self, predicate: P) -> Option<Self::Item>
where Self: Sized, P: FnMut(&Self::Item) -> bool,

Searches for an element of an iterator from the back that satisfies a predicate. Read more
1.0.0 · Source§

impl<T> ExactSizeIterator for Iter<'_, T>

Source§

fn is_empty(&self) -> bool

🔬This is a nightly-only experimental API. (exact_size_is_empty #35428)
Returns true if the iterator is empty. Read more
1.0.0 · Source§

fn len(&self) -> usize

Returns the exact remaining length of the iterator. Read more
1.26.0 · Source§

impl<T> FusedIterator for Iter<'_, T>

1.0.0 · Source§

impl<'a, T> Iterator for Iter<'a, T>

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

fn next(&mut self) -> Option<&'a T>

Advances the iterator and returns the next value. Read more
Source§

fn size_hint(&self) -> (usize, Option<usize>)

Returns the bounds on the remaining length of the iterator. Read more