pub struct LinkedList {
pub head: *mut usize,
}
Expand description
An intrusive linked list
A clean room implementation of the one used in CS140e 2018 Winter
Thanks Sergio Benitez for his excellent work, See CS140e for more information
Fields§
§head: *mut usize
Implementations§
Source§impl LinkedList
impl LinkedList
Sourcepub const fn new() -> LinkedList
pub const fn new() -> LinkedList
Creates a new LinkedList
.
Sourcepub unsafe fn push(&mut self, item: *mut usize)
pub unsafe fn push(&mut self, item: *mut usize)
Push item
to the front of the list.
§Arguments
item
- A*mut usize
item list.
§Safety
Unsafe because we are working with raw pointers.
Sourcepub fn iterator_mut(&mut self) -> IterMut<'_> ⓘ
pub fn iterator_mut(&mut self) -> IterMut<'_> ⓘ
Get a mutable iterator over the items in the list.
Trait Implementations§
Source§impl Clone for LinkedList
impl Clone for LinkedList
Source§fn clone(&self) -> LinkedList
fn clone(&self) -> LinkedList
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for LinkedList
impl Debug for LinkedList
impl Copy for LinkedList
impl Send for LinkedList
Auto Trait Implementations§
impl Freeze for LinkedList
impl RefUnwindSafe for LinkedList
impl !Sync for LinkedList
impl Unpin for LinkedList
impl UnwindSafe for LinkedList
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