pub struct List<T> { /* private fields */ }Expand description
A singly linked list. See the [crate-level documentation] (crate) for more.
Implementations§
source§impl<T> List<T>
impl<T> List<T>
sourcepub fn pop(&mut self) -> Option<T>
pub fn pop(&mut self) -> Option<T>
Removes the element at the front of the List,
and returns it.
sourcepub fn peek(&self) -> Option<&T>
pub fn peek(&self) -> Option<&T>
Returns an immutable reference to the value
at the head of the List, if it exists.
sourcepub fn peek_mut(&mut self) -> Option<&mut T>
pub fn peek_mut(&mut self) -> Option<&mut T>
Returns a mutable reference to the value
at the head of the List, if it exists.
Trait Implementations§
source§impl<T> FromIterator<T> for List<T>
impl<T> FromIterator<T> for List<T>
source§fn from_iter<I>(iter: I) -> Selfwhere
I: IntoIterator<Item = T>,
fn from_iter<I>(iter: I) -> Selfwhere I: IntoIterator<Item = T>,
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl<T> RefUnwindSafe for List<T>where T: RefUnwindSafe,
impl<T> Send for List<T>where T: Send,
impl<T> Sync for List<T>where T: Sync,
impl<T> Unpin for List<T>
impl<T> UnwindSafe for List<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