Struct rustpython_common::linked_list::LinkedList
source · pub struct LinkedList<L, T> { /* private fields */ }
Expand description
An intrusive linked list.
Currently, the list is not emptied on drop. It is the caller’s responsibility to ensure the list is empty before dropping it.
Implementations§
source§impl<L, T> LinkedList<L, T>
impl<L, T> LinkedList<L, T>
sourcepub const fn new() -> LinkedList<L, T>
pub const fn new() -> LinkedList<L, T>
Creates an empty linked list.
source§impl<L: Link> LinkedList<L, L::Target>
impl<L: Link> LinkedList<L, L::Target>
sourcepub fn push_front(&mut self, val: L::Handle)
pub fn push_front(&mut self, val: L::Handle)
Adds an element first in the list.
sourcepub unsafe fn remove(&mut self, node: NonNull<L::Target>) -> Option<L::Handle>
pub unsafe fn remove(&mut self, node: NonNull<L::Target>) -> Option<L::Handle>
Removes the specified node from the list
Safety
The caller must ensure that node
is currently contained by
self
or not contained by any other list.