pub struct LinkedList<T> { /* private fields */ }Expand description
A doubly-linked list.
The name is a lie; it is actually backed by a Vec. The interface reflects what would be possible with a real linked list.
Implementations§
Source§impl<T> LinkedList<T>
impl<T> LinkedList<T>
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> impl DoubleEndedIterator<Item = &T> + ExactSizeIterator
pub fn iter_mut( &mut self, ) -> impl DoubleEndedIterator<Item = &mut T> + ExactSizeIterator
Sourcepub fn cursor_mut_at_start<'a>(&'a mut self) -> CursorMut<'a, T>
pub fn cursor_mut_at_start<'a>(&'a mut self) -> CursorMut<'a, T>
Returns a cursor in the gap before the first element.
Sourcepub fn cursor_mut_at_end<'a>(&'a mut self) -> CursorMut<'a, T>
pub fn cursor_mut_at_end<'a>(&'a mut self) -> CursorMut<'a, T>
Returns a cursor in the gap after the last element.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for LinkedList<T>
impl<T> RefUnwindSafe for LinkedList<T>where
Vec<T>: RefUnwindSafe,
impl<T> Send for LinkedList<T>
impl<T> Sync for LinkedList<T>
impl<T> Unpin for LinkedList<T>
impl<T> UnsafeUnpin for LinkedList<T>where
Vec<T>: UnsafeUnpin,
impl<T> UnwindSafe for LinkedList<T>where
Vec<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