struct HeadTail<I>where
I: Iterator,{
head: I::Item,
tail: I,
}
Expand description
Head element and Tail iterator pair
PartialEq
, Eq
, PartialOrd
and Ord
are implemented by comparing sequences based on
first items (which are guaranteed to exist).
The meanings of PartialOrd
and Ord
are reversed so as to turn the heap used in
KMerge
into a min-heap.
Constructs a HeadTail
from an Iterator
. Returns None
if the Iterator
is empty.
Get the next element and update head
, returning the old head in Some
.
Returns None
when the tail is exhausted (only head
then remains).
Hints at the size of the sequence, same as the Iterator
method.
Performs copy-assignment from
source
.
Read more
Formats the value using the given formatter.
Read more
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning.
Read more
Uses borrowed data to replace owned data, usually by cloning.
Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.