pub struct ArrayQueue<T, const N: usize> { /* private fields */ }
Expand description
A queue backed by a fixed-size array.
Implementations§
Source§impl<T, const N: usize> ArrayQueue<T, N>
impl<T, const N: usize> ArrayQueue<T, N>
Sourcepub const fn first(&self) -> Option<&T>
pub const fn first(&self) -> Option<&T>
Returns a reference to the first element of the queue, or None
if it is empty.
Sourcepub const fn first_mut(&mut self) -> Option<&mut T>
pub const fn first_mut(&mut self) -> Option<&mut T>
Returns a mutable reference to the first element of the queue, or None
if it is empty.
Sourcepub const fn last(&self) -> Option<&T>
pub const fn last(&self) -> Option<&T>
Returns a reference to the last element of the queue, or None
if it is empty.
Sourcepub const fn last_mut(&mut self) -> Option<&mut T>
pub const fn last_mut(&mut self) -> Option<&mut T>
Returns a mutable reference to the last element of the queue, or None
if it is empty.
Sourcepub fn push_front(&mut self, x: T) -> Result<(), CapacityError>
pub fn push_front(&mut self, x: T) -> Result<(), CapacityError>
Pushes an element to the front of the queue.
Trait Implementations§
Source§impl<T, const N: usize> Default for ArrayQueue<T, N>
impl<T, const N: usize> Default for ArrayQueue<T, N>
Source§impl<T, const N: usize> Drop for ArrayQueue<T, N>
impl<T, const N: usize> Drop for ArrayQueue<T, N>
Source§impl<'a, T, const N: usize> IntoIterator for &'a ArrayQueue<T, N>
impl<'a, T, const N: usize> IntoIterator for &'a ArrayQueue<T, N>
Source§impl<'a, T, const N: usize> IntoIterator for &'a mut ArrayQueue<T, N>
impl<'a, T, const N: usize> IntoIterator for &'a mut ArrayQueue<T, N>
Auto Trait Implementations§
impl<T, const N: usize> Freeze for ArrayQueue<T, N>where
T: Freeze,
impl<T, const N: usize> RefUnwindSafe for ArrayQueue<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for ArrayQueue<T, N>where
T: Send,
impl<T, const N: usize> Sync for ArrayQueue<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for ArrayQueue<T, N>where
T: Unpin,
impl<T, const N: usize> UnwindSafe for ArrayQueue<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