pub struct ArrayQueue<T> { /* private fields */ }Expand description
A bounded multi-producer multi-consumer queue.
Implementations§
Source§impl<T> ArrayQueue<T>
impl<T> ArrayQueue<T>
Sourcepub fn new(cap: usize) -> ArrayQueue<T>
pub fn new(cap: usize) -> ArrayQueue<T>
Creates a new bounded queue with the given capacity.
The capacity will be rounded up to the next power of two.
Trait Implementations§
Source§impl<T> Drop for ArrayQueue<T>
Drop all remaining values in the queue when it is dropped.
impl<T> Drop for ArrayQueue<T>
Drop all remaining values in the queue when it is dropped.
Without this, T values sitting in initialized slots would have their
memory freed (the Box<[Slot<T>]> backing is released) without ever
calling T::drop(), leaking resources such as file handles or locks.
impl<T: Send> Send for ArrayQueue<T>
impl<T: Send> Sync for ArrayQueue<T>
Auto Trait Implementations§
impl<T> !Freeze for ArrayQueue<T>
impl<T> !RefUnwindSafe for ArrayQueue<T>
impl<T> Unpin for ArrayQueue<T>
impl<T> UnsafeUnpin for ArrayQueue<T>
impl<T> UnwindSafe for ArrayQueue<T>where
T: 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