pub struct Queue<T, A>where
A: Allocator,{ /* private fields */ }
Expand description
A doubly-linked list that owns elements of type T
backed by the specified allocator A
.
Implementations§
Source§impl<T, A: Allocator> Queue<T, A>
impl<T, A: Allocator> Queue<T, A>
Sourcepub fn try_new_in(alloc: A) -> Result<Self, AllocError>
pub fn try_new_in(alloc: A) -> Result<Self, AllocError>
Creates a new list with specified allocator.
Sourcepub fn iter_mut(&mut self) -> QueueIterMut<'_, T> ⓘ
pub fn iter_mut(&mut self) -> QueueIterMut<'_, T> ⓘ
Returns a mutable iterator over the entries of the list.
Sourcepub fn pop_back(&mut self) -> Option<T>
pub fn pop_back(&mut self) -> Option<T>
Removes the last element and returns it or None
if the list is empty.
Sourcepub fn pop_front(&mut self) -> Option<T>
pub fn pop_front(&mut self) -> Option<T>
Removes the first element and returns it or None
if the list is empty.
Sourcepub fn push_back(&mut self, item: T) -> Result<&mut T, AllocError>
pub fn push_back(&mut self, item: T) -> Result<&mut T, AllocError>
Appends an element to the end of the list.
Sourcepub fn push_front(&mut self, item: T) -> Result<&mut T, AllocError>
pub fn push_front(&mut self, item: T) -> Result<&mut T, AllocError>
Appends an element to the beginning of the list.
Trait Implementations§
impl<T, A> Send for Queue<T, A>
impl<T, A> Sync for Queue<T, A>
Auto Trait Implementations§
impl<T, A> Freeze for Queue<T, A>where
A: Freeze,
impl<T, A> RefUnwindSafe for Queue<T, A>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> Unpin for Queue<T, A>where
A: Unpin,
impl<T, A> UnwindSafe for Queue<T, A>where
A: UnwindSafe,
T: RefUnwindSafe,
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