Skip to main content

PooledStaticQueue

Struct PooledStaticQueue 

Source
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>

Source

pub fn new() -> Self

Constructs a new PooledStaticQueue with slot type Auto

Source

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> Default for PooledStaticQueue<T, N, Auto>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<T, const N: usize, S> MPMCQueue for PooledStaticQueue<T, N, S>
where S: SlotType<ItemHandle<T>>,

Source§

type Item = T

The item stored in the queue
Source§

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>

Attempts to pop an item from the queue. Returns None if the queue was empty. Read more
Source§

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 capacity(&self) -> usize

Returns the total capacity of the queue.
Source§

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

Indicates whether the queue is full. The returned value may be stale under concurrent access and should not be used for synchronization.
Source§

fn force_push(&self, item: Self::Item) -> Option<Self::Item>

Pushes an item into the queue, removing an existing item if the queue is full. Read more
Source§

fn force_push_and_do<F>(&self, item: Self::Item, f: F)
where F: FnMut(Self::Item),

Pushes an item into the queue, removing an existing item if the queue is full. Read more

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>
where T: Send, <S as SlotType<ItemHandle<T>>>::Slot: Send,

§

impl<T, const N: usize, S> Sync for PooledStaticQueue<T, N, S>
where T: Sync, <S as SlotType<ItemHandle<T>>>::Slot: Sync,

§

impl<T, const N: usize, S> Unpin for PooledStaticQueue<T, N, S>
where T: Unpin, <S as SlotType<ItemHandle<T>>>::Slot: Unpin,

§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.