pub struct EntityRingList<E: IEntityRingListNode> {
pub sentinel: E::PtrID,
}Expand description
A doubly-linked ring list of entity pointers.
Fields§
§sentinel: E::PtrIDImplementations§
Source§impl<E: IEntityRingListNode> EntityRingList<E>
impl<E: IEntityRingListNode> EntityRingList<E>
pub fn new(alloc: &EntityAlloc<E>) -> Self
pub fn len(&self, alloc: &EntityAlloc<E>) -> usize
pub fn front_id(&self, alloc: &EntityAlloc<E>) -> Option<E::PtrID>
pub fn back_id(&self, alloc: &EntityAlloc<E>) -> Option<E::PtrID>
pub fn is_empty(&self, alloc: &EntityAlloc<E>) -> bool
pub fn is_single(&self, alloc: &EntityAlloc<E>) -> bool
pub fn is_multiple(&self, alloc: &EntityAlloc<E>) -> bool
pub fn foreach( &self, alloc: &EntityAlloc<E>, pred: impl FnMut(E::PtrID, &E) -> bool, ) -> bool
pub fn forall_with_sentinel( &self, alloc: &EntityAlloc<E>, pred: impl FnMut(E::PtrID, &E) -> bool, ) -> bool
pub fn contains(&self, node: E::PtrID, alloc: &EntityAlloc<E>) -> bool
Sourcepub fn clone_view(&self) -> Self
pub fn clone_view(&self) -> Self
Clone a view over the same ring list (shares the sentinel)
pub fn iter<'alloc>( &'alloc self, alloc: &'alloc EntityAlloc<E>, ) -> EntityRingListReadIter<'alloc, E> ⓘ
pub fn back_iter<'alloc>( &'alloc self, alloc: &'alloc EntityAlloc<E>, ) -> Rev<EntityRingListReadIter<'alloc, E>>
Sourcepub fn push_back_id(
&self,
new_node: E::PtrID,
alloc: &EntityAlloc<E>,
) -> PtrListRes<E>
pub fn push_back_id( &self, new_node: E::PtrID, alloc: &EntityAlloc<E>, ) -> PtrListRes<E>
Push to back (before sentinel)
Sourcepub fn move_all_to(
&self,
other: &EntityRingList<E>,
alloc: &EntityAlloc<E>,
on_move: impl FnMut(E::PtrID),
) -> PtrListRes<E>
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.
Sourcepub 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>
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.
Sourcepub fn clean(&self, alloc: &EntityAlloc<E>)
pub fn clean(&self, alloc: &EntityAlloc<E>)
notifies all nodes in the ring list that the list is being dropped
pub fn pop_back(&self, alloc: &EntityAlloc<E>) -> PtrListRes<E, E::PtrID>
pub fn pop_front(&self, alloc: &EntityAlloc<E>) -> PtrListRes<E, PtrID<E>>
Auto Trait Implementations§
impl<E> Freeze for EntityRingList<E>
impl<E> RefUnwindSafe for EntityRingList<E>
impl<E> Send for EntityRingList<E>
impl<E> Sync for EntityRingList<E>
impl<E> Unpin for EntityRingList<E>
impl<E> UnwindSafe for EntityRingList<E>
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