pub struct LinkedList<T> { /* private fields */ }Expand description
The ❤️ of the module
Implementations§
Source§impl<T: Clone> LinkedList<T>
impl<T: Clone> LinkedList<T>
Sourcepub fn new() -> LinkedList<T>
pub fn new() -> LinkedList<T>
Creates a new list
Sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Removes/returns the head of the list/stack (if Some) in O(1) time
Sourcepub fn enqueue(&mut self, data: T)
pub fn enqueue(&mut self, data: T)
Adds a node to the tail of the list/queue in O(n) time;
TODO: Safely implement a way to store a reference to the last node in the list for O(1) enqueue operations
Sourcepub fn dequeue(&mut self) -> Option<T>
pub fn dequeue(&mut self) -> Option<T>
Removes/returns the head of the list (if Some) in O(1) time
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for LinkedList<T>
impl<T> RefUnwindSafe for LinkedList<T>where
T: RefUnwindSafe,
impl<T> Send for LinkedList<T>where
T: Send,
impl<T> Sync for LinkedList<T>where
T: Sync,
impl<T> Unpin for LinkedList<T>
impl<T> UnwindSafe for LinkedList<T>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