pub struct UnboundQueue<M: RawMutex = CriticalSectionRawMutex>(/* private fields */);Expand description
An unbounded queue implementation using VecDeque from the alloc crate.
Note that this queue does allocate memory on push, and deallocates memory on pop, so it may not be suitable for all use cases (e.g. embedded contexts without an allocator, or contexts where allocations are not allowed in ISRs).
Implementations§
Source§impl<M: RawMutex> UnboundQueue<M>
impl<M: RawMutex> UnboundQueue<M>
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new queue with the specified capacity.
Trait Implementations§
Source§impl<M: RawMutex> Default for UnboundQueue<M>
impl<M: RawMutex> Default for UnboundQueue<M>
Auto Trait Implementations§
impl<M = CriticalSectionRawMutex> !Freeze for UnboundQueue<M>
impl<M = CriticalSectionRawMutex> !RefUnwindSafe for UnboundQueue<M>
impl<M> Send for UnboundQueue<M>where
M: Send,
impl<M> Sync for UnboundQueue<M>where
M: Sync,
impl<M> Unpin for UnboundQueue<M>where
M: Unpin,
impl<M> UnsafeUnpin for UnboundQueue<M>where
M: UnsafeUnpin,
impl<M> UnwindSafe for UnboundQueue<M>where
M: 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