pub struct StableMinHeap<T: Storable + Ord, M: Memory = DefaultMemoryImpl> { /* private fields */ }Expand description
Governed upstream MinHeap; initialization and failures follow upstream contracts.
Implementations§
Source§impl<T: Storable + Ord, M: Memory> StableMinHeap<T, M>
impl<T: Storable + Ord, M: Memory> StableMinHeap<T, M>
Sourcepub fn new(memory: RuntimeMemory<M>) -> Self
pub fn new(memory: RuntimeMemory<M>) -> Self
Create a new collection, replacing any prior collection in the selected memory. This is destructive even when a valid collection already exists.
§Panics
Panics on insufficient memory or codec/backing failure.
Sourcepub fn init(memory: RuntimeMemory<M>) -> Self
pub fn init(memory: RuntimeMemory<M>) -> Self
Open a valid retained collection, or create one in zero-page memory.
§Panics
Panics for foreign magic, unsupported layout, incompatible element bounds, insufficient memory or codec/backing failure. Foreign memory is not reset.
Sourcepub fn push(&mut self, item: &T)
pub fn push(&mut self, item: &T)
Delegates to upstream MinHeap::push with the governed allocation.
Sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Delegates to upstream MinHeap::pop with the governed allocation.
Sourcepub fn peek(&self) -> Option<T>
pub fn peek(&self) -> Option<T>
Delegates to upstream MinHeap::peek with the governed allocation.
Auto Trait Implementations§
impl<T, M = Rc<RefCell<Vec<u8>>>> !Freeze for StableMinHeap<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !RefUnwindSafe for StableMinHeap<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !Send for StableMinHeap<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !Sync for StableMinHeap<T, M>
impl<T, M = Rc<RefCell<Vec<u8>>>> !UnwindSafe for StableMinHeap<T, M>
impl<T, M> Unpin for StableMinHeap<T, M>
impl<T, M> UnsafeUnpin for StableMinHeap<T, M>
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