EntityRingList

Struct EntityRingList 

Source
pub struct EntityRingList<E: IEntityRingListNode> {
    pub sentinel: E::PtrID,
}
Expand description

A doubly-linked ring list of entity pointers.

Fields§

§sentinel: E::PtrID

Implementations§

Source§

impl<E: IEntityRingListNode> EntityRingList<E>

Source

pub fn new(alloc: &EntityAlloc<E>) -> Self

Source

pub fn len(&self, alloc: &EntityAlloc<E>) -> usize

Source

pub fn front_id(&self, alloc: &EntityAlloc<E>) -> Option<E::PtrID>

Source

pub fn back_id(&self, alloc: &EntityAlloc<E>) -> Option<E::PtrID>

Source

pub fn is_empty(&self, alloc: &EntityAlloc<E>) -> bool

Source

pub fn is_single(&self, alloc: &EntityAlloc<E>) -> bool

Source

pub fn is_multiple(&self, alloc: &EntityAlloc<E>) -> bool

Source

pub fn foreach( &self, alloc: &EntityAlloc<E>, pred: impl FnMut(E::PtrID, &E) -> bool, ) -> bool

Source

pub fn forall_with_sentinel( &self, alloc: &EntityAlloc<E>, pred: impl FnMut(E::PtrID, &E) -> bool, ) -> bool

Source

pub fn contains(&self, node: E::PtrID, alloc: &EntityAlloc<E>) -> bool

Source

pub fn clone_view(&self) -> Self

Clone a view over the same ring list (shares the sentinel)

Source

pub fn iter<'alloc>( &'alloc self, alloc: &'alloc EntityAlloc<E>, ) -> EntityRingListReadIter<'alloc, E>

Source

pub fn back_iter<'alloc>( &'alloc self, alloc: &'alloc EntityAlloc<E>, ) -> Rev<EntityRingListReadIter<'alloc, E>>

Source

pub fn push_back_id( &self, new_node: E::PtrID, alloc: &EntityAlloc<E>, ) -> PtrListRes<E>

Push to back (before sentinel)

Source

pub fn move_all_to( &self, other: &EntityRingList<E>, alloc: &EntityAlloc<E>, on_move: impl FnMut(E::PtrID), ) -> PtrListRes<E>

Move all nodes from self into other, preserving order; invoke on_move for each moved node.

Source

pub fn move_to_if( &self, other: &EntityRingList<E>, alloc: &EntityAlloc<E>, predicate: impl FnMut(E::PtrID, &E) -> bool, on_move: impl FnMut(E::PtrID), ) -> PtrListRes<E>

Move nodes that satisfy predicate from self to other, preserving order.

Source

pub fn clean(&self, alloc: &EntityAlloc<E>)

notifies all nodes in the ring list that the list is being dropped

Source

pub fn pop_back(&self, alloc: &EntityAlloc<E>) -> PtrListRes<E, E::PtrID>

Source

pub fn pop_front(&self, alloc: &EntityAlloc<E>) -> PtrListRes<E, PtrID<E>>

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.