Struct alloc::collections::btree::merge_iter::MergeIterInner
source · pub struct MergeIterInner<I: Iterator> {
a: I,
b: I,
peeked: Option<Peeked<I>>,
}
Expand description
Core of an iterator that merges the output of two strictly ascending iterators, for instance a union or a symmetric difference.
Fields§
§a: I
§b: I
§peeked: Option<Peeked<I>>
Implementations§
source§impl<I: Iterator> MergeIterInner<I>
impl<I: Iterator> MergeIterInner<I>
sourcepub fn nexts<Cmp: Fn(&I::Item, &I::Item) -> Ordering>(
&mut self,
cmp: Cmp
) -> (Option<I::Item>, Option<I::Item>)where
I: FusedIterator,
pub fn nexts<Cmp: Fn(&I::Item, &I::Item) -> Ordering>( &mut self, cmp: Cmp ) -> (Option<I::Item>, Option<I::Item>)where I: FusedIterator,
Returns the next pair of items stemming from the pair of sources being merged. If both returned options contain a value, that value is equal and occurs in both sources. If one of the returned options contains a value, that value doesn’t occur in the other source (or the sources are not strictly ascending). If neither returned option contains a value, iteration has finished and subsequent calls will return the same empty pair.
sourcepub fn lens(&self) -> (usize, usize)where
I: ExactSizeIterator,
pub fn lens(&self) -> (usize, usize)where I: ExactSizeIterator,
Returns a pair of upper bounds for the size_hint
of the final iterator.
Trait Implementations§
Auto Trait Implementations§
impl<I> RefUnwindSafe for MergeIterInner<I>where I: RefUnwindSafe, <I as Iterator>::Item: RefUnwindSafe,
impl<I> Send for MergeIterInner<I>where I: Send, <I as Iterator>::Item: Send,
impl<I> Sync for MergeIterInner<I>where I: Sync, <I as Iterator>::Item: Sync,
impl<I> Unpin for MergeIterInner<I>where I: Unpin, <I as Iterator>::Item: Unpin,
impl<I> UnwindSafe for MergeIterInner<I>where I: UnwindSafe, <I as Iterator>::Item: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more