Struct DrainSorted
pub struct DrainSorted<'a, T: Ord, A: Allocator = Global> { pub(in ::collections::binary_heap) inner: &'a mut BinaryHeap<T, A> }
A draining iterator over the elements of a BinaryHeap.
This struct is created by [BinaryHeap::drain_sorted()]. See its
documentation for more.
Fields
inner: &'a mut BinaryHeap<T, A>
Implementations
impl<'a, T: Ord, A: Allocator> DrainSorted<'a, T, A>
fn allocator(&self) -> &AReturns a reference to the underlying allocator.
Trait Implementations
impl<'a, T: Debug + Ord, A: Debug + Allocator> Debug for DrainSorted<'a, T, A>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<'a, T: Ord, A: Allocator> Drop for DrainSorted<'a, T, A>
fn drop(&mut self)Removes heap elements in heap order.
impl<T: Ord, A: Allocator> ExactSizeIterator for DrainSorted<'_, T, A>
impl<T: Ord, A: Allocator> FusedIterator for DrainSorted<'_, T, A>
impl<T: Ord, A: Allocator> Iterator for DrainSorted<'_, T, A>
type Item = T;fn next(&mut self) -> Option<T>fn size_hint(&self) -> (usize, Option<usize>)
impl<T: Ord, A: Allocator> TrustedLen for DrainSorted<'_, T, A>
Auto Trait Implementations
impl<'a, T, A = Global> !UnwindSafe for DrainSorted<'a, T, A>
impl<'a, T, A> Freeze for DrainSorted<'a, T, A>
where
&'a mut BinaryHeap<T, A>: Freeze,
impl<'a, T, A> RefUnwindSafe for DrainSorted<'a, T, A>
where
&'a mut BinaryHeap<T, A>: RefUnwindSafe,
impl<'a, T, A> Send for DrainSorted<'a, T, A>
where
&'a mut BinaryHeap<T, A>: Send,
impl<'a, T, A> Sync for DrainSorted<'a, T, A>
where
&'a mut BinaryHeap<T, A>: Sync,
impl<'a, T, A> Unpin for DrainSorted<'a, T, A>
where
&'a mut BinaryHeap<T, A>: Unpin,
impl<'a, T, A> UnsafeUnpin for DrainSorted<'a, T, A>
where
&'a mut BinaryHeap<T, A>: UnsafeUnpin,
Blanket Implementations
impl<I> IntoIterator for DrainSorted<'a, T, A>
where
I: Iterator,
type Item = <I as Iterator>::Item;type IntoIter = I;fn into_iter(self) -> I
impl<T> Any for DrainSorted<'a, T, A>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for DrainSorted<'a, T, A>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for DrainSorted<'a, T, A>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for DrainSorted<'a, T, A>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> SizeHint for DrainSorted<'a, T, A>
where
T: ?Sized,
fn lower_bound(&self) -> usizefn upper_bound(&self) -> Option<usize>
impl<T> SizedTypeProperties for DrainSorted<'a, T, A>
impl<T, U> Into<U> for DrainSorted<'a, T, A>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for DrainSorted<'a, T, A>
where
U: Into<T>,
type Error = Infallible;fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto<U> for DrainSorted<'a, T, A>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>