pub trait IBasicEntityListID: IPoliciedID {
// Required methods
fn obj_load_head(obj: &Self::ObjectT) -> EntityListNodeHead<Self>;
fn obj_store_head(obj: &Self::ObjectT, head: EntityListNodeHead<Self>);
fn obj_is_sentinel(obj: &Self::ObjectT) -> bool;
fn new_sentinel_obj() -> Self::ObjectT;
fn on_push_prev(
self,
prev: Self,
alloc: &IDBoundAlloc<Self>,
) -> EntityListRes<Self>;
fn on_push_next(
self,
next: Self,
alloc: &IDBoundAlloc<Self>,
) -> EntityListRes<Self>;
fn on_unplug(self, alloc: &IDBoundAlloc<Self>) -> EntityListRes<Self>;
// Provided methods
fn is_sentinel(self, alloc: &IDBoundAlloc<Self>) -> bool { ... }
fn new_sentinel(alloc: &IDBoundAlloc<Self>) -> Self { ... }
fn get_prev_id(self, alloc: &IDBoundAlloc<Self>) -> Option<Self> { ... }
fn get_next_id(self, alloc: &IDBoundAlloc<Self>) -> Option<Self> { ... }
fn is_attached(self, alloc: &IDBoundAlloc<Self>) -> bool { ... }
}Expand description
Basic doublely-linked list ID concept. Provides basic header(prev|next) management,
signals for list operations, and sentinel node support.
Required Methods§
Sourcefn obj_load_head(obj: &Self::ObjectT) -> EntityListNodeHead<Self>
fn obj_load_head(obj: &Self::ObjectT) -> EntityListNodeHead<Self>
Load the EntityListNodeHead from the entity object.
Sourcefn obj_store_head(obj: &Self::ObjectT, head: EntityListNodeHead<Self>)
fn obj_store_head(obj: &Self::ObjectT, head: EntityListNodeHead<Self>)
NOTE: Entity Lists are internally mutable
Sourcefn obj_is_sentinel(obj: &Self::ObjectT) -> bool
fn obj_is_sentinel(obj: &Self::ObjectT) -> bool
Check if the entity object is a sentinel node.
Sourcefn new_sentinel_obj() -> Self::ObjectT
fn new_sentinel_obj() -> Self::ObjectT
Create a new sentinel entity object.
Sourcefn on_push_prev(
self,
prev: Self,
alloc: &IDBoundAlloc<Self>,
) -> EntityListRes<Self>
fn on_push_prev( self, prev: Self, alloc: &IDBoundAlloc<Self>, ) -> EntityListRes<Self>
Signal: invoked when this node is being added after prev node.
Sourcefn on_push_next(
self,
next: Self,
alloc: &IDBoundAlloc<Self>,
) -> EntityListRes<Self>
fn on_push_next( self, next: Self, alloc: &IDBoundAlloc<Self>, ) -> EntityListRes<Self>
Signal: invoked when this node is being added before next node.
Sourcefn on_unplug(self, alloc: &IDBoundAlloc<Self>) -> EntityListRes<Self>
fn on_unplug(self, alloc: &IDBoundAlloc<Self>) -> EntityListRes<Self>
Signal: invoked when this node is being unplugged from a list.
Provided Methods§
Sourcefn is_sentinel(self, alloc: &IDBoundAlloc<Self>) -> bool
fn is_sentinel(self, alloc: &IDBoundAlloc<Self>) -> bool
Check if this node ID is a sentinel.
Sourcefn new_sentinel(alloc: &IDBoundAlloc<Self>) -> Self
fn new_sentinel(alloc: &IDBoundAlloc<Self>) -> Self
Create a new sentinel node ID allocated from the given allocator.
Sourcefn get_prev_id(self, alloc: &IDBoundAlloc<Self>) -> Option<Self>
fn get_prev_id(self, alloc: &IDBoundAlloc<Self>) -> Option<Self>
Get the previous node ID, if any.
Sourcefn get_next_id(self, alloc: &IDBoundAlloc<Self>) -> Option<Self>
fn get_next_id(self, alloc: &IDBoundAlloc<Self>) -> Option<Self>
Get the next node ID, if any.
Sourcefn is_attached(self, alloc: &IDBoundAlloc<Self>) -> bool
fn is_attached(self, alloc: &IDBoundAlloc<Self>) -> bool
Check if this node is currently attached to a list.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.