pub struct DoublyLinkedList<T> { /* private fields */ }Expand description
A doubly linked list.
Implementations§
Source§impl<T> DoublyLinkedList<T>
impl<T> DoublyLinkedList<T>
Sourcepub fn insert(&mut self, index: usize, value: T) -> Result<(), Error>
pub fn insert(&mut self, index: usize, value: T) -> Result<(), Error>
Inserts a value at the given index.
Sourcepub fn remove(&mut self, value: &T) -> Result<(), Error>where
T: PartialEq,
pub fn remove(&mut self, value: &T) -> Result<(), Error>where
T: PartialEq,
Removes the first occurrence of a value.
Sourcepub fn pop(&mut self, index: Option<usize>) -> Result<T, Error>
pub fn pop(&mut self, index: Option<usize>) -> Result<T, Error>
Removes and returns the item at the given index, defaulting to the last.
Trait Implementations§
Source§impl<T: Debug> Debug for DoublyLinkedList<T>
impl<T: Debug> Debug for DoublyLinkedList<T>
Auto Trait Implementations§
impl<T> Freeze for DoublyLinkedList<T>
impl<T> RefUnwindSafe for DoublyLinkedList<T>where
Vec<DNode<T>>: RefUnwindSafe,
impl<T> Send for DoublyLinkedList<T>
impl<T> Sync for DoublyLinkedList<T>
impl<T> Unpin for DoublyLinkedList<T>
impl<T> UnsafeUnpin for DoublyLinkedList<T>where
Vec<DNode<T>>: UnsafeUnpin,
impl<T> UnwindSafe for DoublyLinkedList<T>where
Vec<DNode<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