pub struct TinySetQueuePow2<'a, T, S>where
S: SetBacking + ?Sized,{ /* private fields */ }Expand description
A power-of-two capacity variant that uses bit masking for wrap-around.
As with TinySetQueue, membership is direct-mapped: the membership backing must be
large enough to cover the entire domain addressable by T::into().
Implementations§
Source§impl<'a, T, S> TinySetQueuePow2<'a, T, S>
impl<'a, T, S> TinySetQueuePow2<'a, T, S>
Sourcepub fn new(
buf: &'a mut [T],
in_queue: &'a mut S,
mode: MembershipMode,
order: ProcessingOrder,
) -> Self
pub fn new( buf: &'a mut [T], in_queue: &'a mut S, mode: MembershipMode, order: ProcessingOrder, ) -> Self
Constructs a queue backed by power-of-two-sized storage.
§Panics
Panics if buf.len() is not a power of two.
pub fn capacity(&self) -> usize
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn is_full(&self) -> bool
pub fn push(&mut self, value: T) -> Result<PushResult, T>
pub fn pop(&mut self) -> Option<T>
Auto Trait Implementations§
impl<'a, T, S> Freeze for TinySetQueuePow2<'a, T, S>where
S: ?Sized,
impl<'a, T, S> RefUnwindSafe for TinySetQueuePow2<'a, T, S>
impl<'a, T, S> Send for TinySetQueuePow2<'a, T, S>
impl<'a, T, S> Sync for TinySetQueuePow2<'a, T, S>
impl<'a, T, S> Unpin for TinySetQueuePow2<'a, T, S>where
S: ?Sized,
impl<'a, T, S> !UnwindSafe for TinySetQueuePow2<'a, T, S>
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