pub struct EntityRingList<I: IEntityRingListNodeID> {
pub sentinel: I,
}Fields§
§sentinel: IImplementations§
Source§impl<I: IEntityRingListNodeID> EntityRingList<I>
impl<I: IEntityRingListNodeID> EntityRingList<I>
Sourcepub fn new(alloc: &EntityAlloc<I::ObjectT, I::PolicyT>) -> Self
pub fn new(alloc: &EntityAlloc<I::ObjectT, I::PolicyT>) -> Self
Create a new empty ring list with a sentinel node.
pub fn front_id(&self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>) -> Option<I>
pub fn back_id(&self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>) -> Option<I>
pub fn is_empty(&self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>) -> bool
pub fn is_single(&self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>) -> bool
pub fn is_multiple(&self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>) -> bool
Sourcepub fn foreach(
&self,
alloc: &EntityAlloc<I::ObjectT, I::PolicyT>,
pred: impl FnMut(I, &I::ObjectT) -> bool,
) -> bool
pub fn foreach( &self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>, pred: impl FnMut(I, &I::ObjectT) -> bool, ) -> bool
traverse each node in the list, invoking pred on each node.
§panics
If a broken ring list is detected, this function will panic.
Sourcepub fn forall_with_sentinel(
&self,
alloc: &EntityAlloc<I::ObjectT, I::PolicyT>,
pred: impl FnMut(I, &I::ObjectT) -> bool,
) -> bool
pub fn forall_with_sentinel( &self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>, pred: impl FnMut(I, &I::ObjectT) -> bool, ) -> bool
traverse each node in the list starting from the sentinel, invoking pred on each node.
§panics
If a broken ring list is detected, this function will panic.
pub fn len(&self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>) -> usize
pub fn contains( &self, node: I, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>, ) -> bool
pub fn clone_view(&self) -> Self
pub fn push_back( &self, new_node: I, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>, ) -> EntityListRes<I>
pub fn pop_back( &self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>, ) -> EntityListRes<I, I>
pub fn pop_front( &self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>, ) -> EntityListRes<I, I>
Sourcepub fn move_all_to(
&self,
other: &Self,
alloc: &EntityAlloc<I::ObjectT, I::PolicyT>,
on_move: impl FnMut(I),
) -> EntityListRes<I>
pub fn move_all_to( &self, other: &Self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>, on_move: impl FnMut(I), ) -> EntityListRes<I>
Move all nodes from self into other, preserving order; invoke on_move for each moved node.
Sourcepub fn move_to_if(
&self,
other: &Self,
alloc: &EntityAlloc<I::ObjectT, I::PolicyT>,
pred: impl FnMut(I, &I::ObjectT) -> bool,
on_move: impl FnMut(I),
) -> EntityListRes<I>
pub fn move_to_if( &self, other: &Self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>, pred: impl FnMut(I, &I::ObjectT) -> bool, on_move: impl FnMut(I), ) -> EntityListRes<I>
Move nodes that satisfy predicate from self to other, preserving order.
pub fn clean(&self, alloc: &EntityAlloc<I::ObjectT, I::PolicyT>)
pub fn iter<'a>( &self, alloc: &'a EntityAlloc<I::ObjectT, I::PolicyT>, ) -> EntityRingListIter<'a, I> ⓘ
Auto Trait Implementations§
impl<I> Freeze for EntityRingList<I>where
I: Freeze,
impl<I> RefUnwindSafe for EntityRingList<I>where
I: RefUnwindSafe,
impl<I> Send for EntityRingList<I>where
I: Send,
impl<I> Sync for EntityRingList<I>where
I: Sync,
impl<I> Unpin for EntityRingList<I>where
I: Unpin,
impl<I> UnwindSafe for EntityRingList<I>where
I: UnwindSafe,
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