EntityList

Struct EntityList 

Source
pub struct EntityList<E: IEntityListNode> {
    pub head: PtrID<E>,
    pub tail: PtrID<E>,
    pub len: Cell<usize>,
}

Fields§

§head: PtrID<E>§tail: PtrID<E>§len: Cell<usize>

Implementations§

Source§

impl<E: IEntityListNode> EntityList<E>

Source

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

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

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

Source

pub fn push_back_val(&self, val: E, alloc: &EntityAlloc<E>) -> PtrListRes<E>

Source

pub fn push_front_val(&self, val: E, alloc: &EntityAlloc<E>) -> PtrListRes<E>

Source

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

Source

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

Source

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

Source

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

Source

pub fn get_range(&self, alloc: &EntityAlloc<E>) -> EntityListRange<E>

Source

pub fn get_range_with_sentinels(&self) -> EntityListRange<E>

Get the range including sentinels.

Source

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

Source

pub fn iter_with_sentinels<'alloc>( &'alloc self, alloc: &'alloc EntityAlloc<E>, ) -> EntityListReadIter<'alloc, E>

Auto Trait Implementations§

§

impl<E> !Freeze for EntityList<E>

§

impl<E> !RefUnwindSafe for EntityList<E>

§

impl<E> Send for EntityList<E>
where E: Send,

§

impl<E> !Sync for EntityList<E>

§

impl<E> Unpin for EntityList<E>

§

impl<E> UnwindSafe for EntityList<E>
where E: RefUnwindSafe,

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.