pub struct PooledStaticQueue<T, const N: usize, S = Auto>where
S: SlotType<ItemHandle<T>>,{ /* private fields */ }Expand description
A pooled MPMCQueue with capacity N.
Unlike StaticQueue, this queue may store any item at the cost of higher runtime and higher memory.
Only available on feature pool
Implementations§
Source§impl<T, const N: usize> PooledStaticQueue<T, N, Auto>
impl<T, const N: usize> PooledStaticQueue<T, N, Auto>
Sourcepub fn with_slot<S>() -> PooledStaticQueue<T, N, S>where
S: SlotType<ItemHandle<T>>,
pub fn with_slot<S>() -> PooledStaticQueue<T, N, S>where
S: SlotType<ItemHandle<T>>,
Constructs a new PooledStaticQueue with slot type S
Trait Implementations§
Source§impl<T, const N: usize, S> MPMCQueue for PooledStaticQueue<T, N, S>where
S: SlotType<ItemHandle<T>>,
impl<T, const N: usize, S> MPMCQueue for PooledStaticQueue<T, N, S>where
S: SlotType<ItemHandle<T>>,
Source§fn push(&self, item: Self::Item) -> Result<(), Self::Item>
fn push(&self, item: Self::Item) -> Result<(), Self::Item>
Attempts to push an item into the queue.
Returns the item as an error if the queue is full. Read more
Source§fn pop(&self) -> Option<Self::Item>
fn pop(&self) -> Option<Self::Item>
Attempts to pop an item from the queue.
Returns
None if the queue was empty. Read moreSource§fn len(&self) -> usize
fn len(&self) -> usize
Returns the current len of the queue.
The returned value may be stale under concurrent access and should not be used for synchronization.
Source§fn is_empty(&self) -> bool
fn is_empty(&self) -> bool
Indicates whether the queue is empty.
The returned value may be stale under concurrent access and should not be used for synchronization.
Source§fn is_full(&self) -> bool
fn is_full(&self) -> bool
Indicates whether the queue is full.
The returned value may be stale under concurrent access and should not be used for synchronization.
Auto Trait Implementations§
impl<T, const N: usize, S = Auto> !Freeze for PooledStaticQueue<T, N, S>
impl<T, const N: usize, S = Auto> !RefUnwindSafe for PooledStaticQueue<T, N, S>
impl<T, const N: usize, S> Send for PooledStaticQueue<T, N, S>
impl<T, const N: usize, S> Sync for PooledStaticQueue<T, N, S>
impl<T, const N: usize, S> Unpin for PooledStaticQueue<T, N, S>
impl<T, const N: usize, S> UnsafeUnpin for PooledStaticQueue<T, N, S>where
<S as SlotType<ItemHandle<T>>>::Slot: UnsafeUnpin,
T: UnsafeUnpin,
impl<T, const N: usize, S> UnwindSafe for PooledStaticQueue<T, N, S>where
T: UnwindSafe,
<S as SlotType<ItemHandle<T>>>::Slot: UnwindSafe,
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