PinList

Struct PinList 

Source
pub struct PinList<T: ?Sized + Types> { /* private fields */ }
Expand description

An intrusive linked list.

Implementations§

Source§

impl<T: ?Sized> PinList<T>
where <T as ConstFnBounds>::Type: Types,

Source

pub const fn new(id: Unique<<<T as ConstFnBounds>::Type as Types>::Id>) -> Self

Create a new empty PinList from a unique ID.

Source§

impl<T: ?Sized + Types> PinList<T>

Source

pub fn is_empty(&self) -> bool

Check whether there are any nodes in this list.

Source

pub fn cursor_ghost(&self) -> Cursor<'_, T>

Obtain a Cursor pointing to the “ghost” element of the list.

Source

pub fn cursor_front(&self) -> Cursor<'_, T>

Obtain a Cursor pointing to the first element of the list, or the ghost element if the list is empty.

Source

pub fn cursor_back(&self) -> Cursor<'_, T>

Obtain a Cursor pointing to the last element of the list, or the ghost element if the list is empty.

Source

pub fn cursor_ghost_mut(&mut self) -> CursorMut<'_, T>

Obtain a CursorMut pointing to the “ghost” element of the list.

Source

pub fn cursor_front_mut(&mut self) -> CursorMut<'_, T>

Obtain a CursorMut pointing to the first element of the list, or the ghost element if the list is empty.

Source

pub fn cursor_back_mut(&mut self) -> CursorMut<'_, T>

Obtain a CursorMut pointing to the last element of the list, or the ghost element if the list is empty.

Source

pub fn push_front<'node>( &mut self, node: Pin<&'node mut Node<T>>, protected: T::Protected, unprotected: T::Unprotected, ) -> Pin<&'node mut InitializedNode<'node, T>>

Append a node to the front of the list.

§Panics

Panics if the node is not in its initial state.

Source

pub fn push_back<'node>( &mut self, node: Pin<&'node mut Node<T>>, protected: T::Protected, unprotected: T::Unprotected, ) -> Pin<&'node mut InitializedNode<'node, T>>

Append a node to the back of the list.

§Panics

Panics if the node is not in its initial state.

Trait Implementations§

Source§

impl<T: ?Sized + Types> Debug for PinList<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: ?Sized + Types> Send for PinList<T>
where T::Id: Send, T::Protected: Send, T::Removed: Send, T::Unprotected: Sync,

Source§

impl<T: ?Sized + Types> Sync for PinList<T>
where T::Id: Sync, T::Protected: Send + Sync, T::Removed: Send, T::Unprotected: Sync,

Auto Trait Implementations§

§

impl<T> Freeze for PinList<T>
where <T as Types>::Id: Freeze, T: ?Sized,

§

impl<T> !RefUnwindSafe for PinList<T>

§

impl<T> Unpin for PinList<T>
where <T as Types>::Id: Unpin, T: ?Sized,

§

impl<T> !UnwindSafe for PinList<T>

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.