pub struct LinkedList<L: Link> { /* 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: Link> LinkedList<L>
impl<L: Link> LinkedList<L>
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 fn pop_front(&mut self) -> Option<L::Handle>
pub fn pop_front(&mut self) -> Option<L::Handle>
Removes the first element from the list and returns it, or None if empty.
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<L: Link> LinkedList<L>
impl<L: Link> LinkedList<L>
pub const fn drain_filter<F>(&mut self, filter: F) -> DrainFilter<'_, L, F> ⓘ
Trait Implementations§
Source§impl<L: Link> Debug for LinkedList<L>
impl<L: Link> Debug for LinkedList<L>
Source§impl<L: Link> Default for LinkedList<L>
impl<L: Link> Default for LinkedList<L>
impl<L: Link> Send for LinkedList<L>
impl<L: Link> Sync for LinkedList<L>
Auto Trait Implementations§
impl<L> Freeze for LinkedList<L>
impl<L> RefUnwindSafe for LinkedList<L>
impl<L> Unpin for LinkedList<L>
impl<L> UnsafeUnpin for LinkedList<L>
impl<L> UnwindSafe for LinkedList<L>
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
impl<T, U> ImaginaryInto<U> for Twhere
U: ImaginaryFrom<T>,
fn imaginary_into(self) -> U
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more