InternalArrayStorage

Struct InternalArrayStorage 

Source
pub struct InternalArrayStorage<'a, IT: Iterator> { /* private fields */ }
Expand description

Internal representation of the ArrayStorage that’s actually used as the MergeIter’s Storage backend.

Trait Implementations§

Source§

impl<IT: Iterator> BaseStorage for InternalArrayStorage<'_, IT>

Source§

type IT = IT

Iterator contained in this storage
Source§

fn heap(&self) -> *mut *mut PeekIter<IT>

Pointer to the heap of pointers
Source§

fn len(&self) -> usize

Length of the heap of pointers
Source§

unsafe fn set_len(&mut self, new_len: usize)

Set the length of the storage Read more
Source§

fn is_empty(&self) -> bool

Returns true if Self::len == 0
Source§

impl<IT: Iterator> Debug for InternalArrayStorage<'_, IT>
where PeekIter<<Self as BaseStorage>::IT>: Debug,

Source§

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

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

impl<IT: Iterator> Drop for InternalArrayStorage<'_, IT>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<'a, IT> Send for InternalArrayStorage<'a, IT>
where IT: Iterator, Pin<&'a mut ArrayStorage<1, IT>>: Send,

Source§

impl<'a, IT> Sync for InternalArrayStorage<'a, IT>
where IT: Iterator, Pin<&'a mut ArrayStorage<1, IT>>: Sync,

Auto Trait Implementations§

§

impl<'a, IT> Freeze for InternalArrayStorage<'a, IT>

§

impl<'a, IT> !RefUnwindSafe for InternalArrayStorage<'a, IT>

§

impl<'a, IT> Unpin for InternalArrayStorage<'a, IT>

§

impl<'a, IT> !UnwindSafe for InternalArrayStorage<'a, IT>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<S> Storage for S
where S: StorageOps,

Source§

fn into_builder(self) -> DefaultBuilder<Self>

Create a new builder with default parameters for this storage
Source§

impl<S> StorageOps for S
where S: BaseStorage,

Source§

unsafe fn dec_len(&mut self) -> usize

Decrements length by 1 and returns the new length. Does nothing to the last item, so self.heap().add(self.dec_len()) is still a valid pointer to a live item, but you are guaranteed that this trait will never return it again (if safety contracts are not broken) Read more
Source§

unsafe fn first(&self) -> *mut *mut PeekIter<Self::IT>

Produces pointer to the first (smallest) item Pointers are valid, initialized and unique It’s valid to treat them as mut refs if no other mut refs to the first() exist. Read more
Source§

unsafe fn second(&self) -> *mut *mut PeekIter<Self::IT>

Produces pointer to the second (second-smallest) item which is also the root of the binary heap. Pointers are valid, initialized and unique It’s valid to treat them as mut refs if no other mut refs to the second() exist. Read more
Source§

unsafe fn pop_last(&mut self) -> *mut PeekIter<Self::IT>

Produces pointer to the last item in the heap and decrements its length by 1. Pointers are valid, initialized and unique It’s valid to treat them as mut refs. Read more
Source§

fn clear(&mut self)

Drops all remaining items in the storage and sets its length to 0. It’s safe to call multiple times (repeated calls are no-ops)
Source§

fn map_items(&self, func: impl FnMut(&PeekIter<Self::IT>))

Iterates over all items in the heap and calls func for each Only the first two items are in order, order of the rest is unspecified.
Source§

fn peek(&self) -> Option<&Item<Self>>

Peeks the first item of the heap
Source§

fn pop_last_item(&mut self) -> Option<(Item<Self>, Self::IT)>

Pops the last item+iterator tuple in the heap (no order guaranteed, heap structure is preserved)
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.