pub struct BucketQueueU8 {
queue: BucketQueue8,
}Expand description
A fixed 8-bit-universe max-priority queue. BinaryHeap::peek_mut can be faster for replacements in tiny queues.
Fields§
§queue: BucketQueue8Implementations§
Source§impl BucketQueueU8
impl BucketQueueU8
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn peek(&self) -> Option<u8>
Sourcepub fn push(&mut self, value: u8)
pub fn push(&mut self, value: u8)
§Panics
Panics if the queue already contains u32::MAX values.
pub fn pop(&mut self) -> Option<u8>
Sourcepub fn replace(&mut self, value: u8) -> Option<u8>
pub fn replace(&mut self, value: u8) -> Option<u8>
Unconditionally replaces the greatest value, or inserts into an empty queue.
pub fn clear(&mut self)
Trait Implementations§
Source§impl Clone for BucketQueueU8
impl Clone for BucketQueueU8
Source§impl Debug for BucketQueueU8
impl Debug for BucketQueueU8
Source§impl Default for BucketQueueU8
impl Default for BucketQueueU8
Source§impl Extend<u8> for BucketQueueU8
impl Extend<u8> for BucketQueueU8
Source§fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = u8>,
fn extend<I>(&mut self, iter: I)where
I: IntoIterator<Item = u8>,
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<u8> for BucketQueueU8
impl FromIterator<u8> for BucketQueueU8
Auto Trait Implementations§
impl Freeze for BucketQueueU8
impl RefUnwindSafe for BucketQueueU8
impl Send for BucketQueueU8
impl Sync for BucketQueueU8
impl Unpin for BucketQueueU8
impl UnsafeUnpin for BucketQueueU8
impl UnwindSafe for BucketQueueU8
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