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>
impl<E: IEntityListNode> EntityList<E>
Sourcepub fn new(alloc: &EntityAlloc<E>) -> Self
pub fn new(alloc: &EntityAlloc<E>) -> Self
create a new empty list with head and tail sentinels linked with each other.
Sourcepub fn get_front_id(&self, alloc: &EntityAlloc<E>) -> Option<E::PtrID>
pub fn get_front_id(&self, alloc: &EntityAlloc<E>) -> Option<E::PtrID>
try to get the front node ID, or None if the list is empty
Sourcepub fn get_back_id(&self, alloc: &EntityAlloc<E>) -> Option<E::PtrID>
pub fn get_back_id(&self, alloc: &EntityAlloc<E>) -> Option<E::PtrID>
try to get the back node ID, or None if the list is empty
Sourcepub fn node_add_next(
&self,
node: E::PtrID,
new_node: E::PtrID,
alloc: &EntityAlloc<E>,
) -> PtrListRes<E>
pub fn node_add_next( &self, node: E::PtrID, new_node: E::PtrID, alloc: &EntityAlloc<E>, ) -> PtrListRes<E>
Add a new node after an existing node linked to this list.
If the current node is linked to another list, then the operation is undefined. You’ll get a broken list without reporting an error.
Sourcepub fn node_add_prev(
&self,
node: E::PtrID,
new_node: E::PtrID,
alloc: &EntityAlloc<E>,
) -> PtrListRes<E>
pub fn node_add_prev( &self, node: E::PtrID, new_node: E::PtrID, alloc: &EntityAlloc<E>, ) -> PtrListRes<E>
Add a new node before an existing node linked to this list.
If the current node is linked to another list, then the operation is undefined. You’ll get a broken list without reporting an error.
pub fn node_unplug( &self, node: E::PtrID, alloc: &EntityAlloc<E>, ) -> PtrListRes<E>
pub fn push_back_id( &self, new_node: E::PtrID, alloc: &EntityAlloc<E>, ) -> PtrListRes<E>
pub fn push_front_id( &self, new_node: E::PtrID, alloc: &EntityAlloc<E>, ) -> PtrListRes<E>
pub fn push_back_val(&self, val: E, alloc: &EntityAlloc<E>) -> PtrListRes<E>
pub fn push_front_val(&self, val: E, alloc: &EntityAlloc<E>) -> PtrListRes<E>
pub fn pop_back(&self, alloc: &EntityAlloc<E>) -> PtrListRes<E, E::PtrID>
pub fn pop_front(&self, alloc: &EntityAlloc<E>) -> PtrListRes<E, E::PtrID>
pub fn foreach( &self, alloc: &EntityAlloc<E>, f: impl FnMut(E::PtrID, &E) -> bool, ) -> bool
pub fn forall_with_sentinel( &self, alloc: &EntityAlloc<E>, f: impl FnMut(E::PtrID, &E) -> bool, ) -> bool
pub fn get_range(&self, alloc: &EntityAlloc<E>) -> EntityListRange<E>
Sourcepub fn get_range_with_sentinels(&self) -> EntityListRange<E>
pub fn get_range_with_sentinels(&self) -> EntityListRange<E>
Get the range including sentinels.
pub fn iter<'alloc>( &'alloc self, alloc: &'alloc EntityAlloc<E>, ) -> EntityListReadIter<'alloc, E> ⓘ
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> 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