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.
pub fn iter(&self) -> impl Iterator<Item = &L::Target>
source§impl<T: Link> LinkedList<T, T::Target>
impl<T: Link> LinkedList<T, T::Target>
pub fn drain_filter<F>(&mut self, filter: F) -> DrainFilter<'_, T, F> ⓘ
Trait Implementations§
impl<L: Link> Send for LinkedList<L, L::Target>
impl<L: Link> Sync for LinkedList<L, L::Target>
Auto Trait Implementations§
impl<L, T> Freeze for LinkedList<L, T>
impl<L, T> RefUnwindSafe for LinkedList<L, T>where
L: RefUnwindSafe,
T: RefUnwindSafe,
impl<L, T> Unpin for LinkedList<L, T>
impl<L, T> UnwindSafe for LinkedList<L, T>where
T: RefUnwindSafe,
L: RefUnwindSafe,
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