pub struct BucketQueueU16 {
queue: BucketQueue16,
}Expand description
A fixed 16-bit-universe max-priority queue that allocates about 264 KiB when empty. BinaryHeap can be faster for small queues.
Fields§
§queue: BucketQueue16Implementations§
Source§impl BucketQueueU16
impl BucketQueueU16
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn peek(&self) -> Option<u16>
Sourcepub fn push(&mut self, value: u16)
pub fn push(&mut self, value: u16)
§Panics
Panics if the queue already contains u32::MAX values.
pub fn pop(&mut self) -> Option<u16>
Sourcepub fn replace(&mut self, value: u16) -> Option<u16>
pub fn replace(&mut self, value: u16) -> Option<u16>
Unconditionally replaces the greatest value, or inserts into an empty queue.
pub fn clear(&mut self)
Trait Implementations§
Source§impl Clone for BucketQueueU16
impl Clone for BucketQueueU16
Source§impl Debug for BucketQueueU16
impl Debug for BucketQueueU16
Source§impl Default for BucketQueueU16
impl Default for BucketQueueU16
Source§impl Extend<u16> for BucketQueueU16
impl Extend<u16> for BucketQueueU16
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = u16>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = u16>,
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl FromIterator<u16> for BucketQueueU16
impl FromIterator<u16> for BucketQueueU16
Auto Trait Implementations§
impl Freeze for BucketQueueU16
impl RefUnwindSafe for BucketQueueU16
impl Send for BucketQueueU16
impl Sync for BucketQueueU16
impl Unpin for BucketQueueU16
impl UnsafeUnpin for BucketQueueU16
impl UnwindSafe for BucketQueueU16
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