pub(super) 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(super) fn new(a: I, b: I) -> Self
pub(super) fn new(a: I, b: I) -> Self
Creates a new core for an iterator merging a pair of sources.
Sourcepub(super) fn nexts<Cmp: Fn(&I::Item, &I::Item) -> Ordering>(
&mut self,
cmp: Cmp,
) -> (Option<I::Item>, Option<I::Item>)where
I: FusedIterator,
pub(super) 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(super) fn lens(&self) -> (usize, usize)where
I: ExactSizeIterator,
pub(super) fn lens(&self) -> (usize, usize)where
I: ExactSizeIterator,
Returns a pair of upper bounds for the size_hint
of the final iterator.
Trait Implementations§
Source§impl<I> Clone for MergeIterInner<I>
impl<I> Clone for MergeIterInner<I>
Auto Trait Implementations§
impl<I> Freeze for MergeIterInner<I>
impl<I> RefUnwindSafe for MergeIterInner<I>
impl<I> Send for MergeIterInner<I>
impl<I> Sync for MergeIterInner<I>
impl<I> Unpin for MergeIterInner<I>
impl<I> UnwindSafe for MergeIterInner<I>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
🔬This is a nightly-only experimental API. (
sized_type_properties
)The largest safe length for a
[Self]
. Read more