pub struct RadixHeapU32<T> {
buckets: [Vec<(u32, T)>; 33],
last: u32,
len: usize,
}Expand description
A min-priority queue whose removed keys are monotonically nondecreasing.
Values with equal keys have no specified removal order.
Fields§
§buckets: [Vec<(u32, T)>; 33]§last: u32§len: usizeImplementations§
Source§impl<T> RadixHeapU32<T>
impl<T> RadixHeapU32<T>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn push(&mut self, key: u32, value: T)
pub fn push(&mut self, key: u32, value: T)
Inserts a value whose key is not less than the key most recently removed.
§Panics
Panics if key is less than the key most recently removed.
pub fn pop(&mut self) -> Option<(u32, T)>
pub fn clear(&mut self)
fn bucket_index(key: u32, last: u32) -> usize
Trait Implementations§
Source§impl<T: Clone> Clone for RadixHeapU32<T>
impl<T: Clone> Clone for RadixHeapU32<T>
Source§impl<T: Debug> Debug for RadixHeapU32<T>
impl<T: Debug> Debug for RadixHeapU32<T>
Auto Trait Implementations§
impl<T> Freeze for RadixHeapU32<T>
impl<T> RefUnwindSafe for RadixHeapU32<T>
impl<T> Send for RadixHeapU32<T>
impl<T> Sync for RadixHeapU32<T>
impl<T> Unpin for RadixHeapU32<T>
impl<T> UnsafeUnpin for RadixHeapU32<T>
impl<T> UnwindSafe for RadixHeapU32<T>
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