pub struct Queue<T, const N: usize> { /* private fields */ }Expand description
A queue holding N-1 elements.
Why N-1? Because [T; N+1] isn’t supported, and ringbuffers/circular buffers generally waste 1 element in an optimal implementation. https://github.com/rust-lang/rust/issues/76560
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Queue<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for Queue<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Queue<T, N>where
T: Send,
impl<T, const N: usize> Sync for Queue<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for Queue<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for Queue<T, N>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