Skip to main content

IBasicEntityListID

Trait IBasicEntityListID 

Source
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§

Source

fn obj_load_head(obj: &Self::ObjectT) -> EntityListNodeHead<Self>

Load the EntityListNodeHead from the entity object.

Source

fn obj_store_head(obj: &Self::ObjectT, head: EntityListNodeHead<Self>)

NOTE: Entity Lists are internally mutable

Source

fn obj_is_sentinel(obj: &Self::ObjectT) -> bool

Check if the entity object is a sentinel node.

Source

fn new_sentinel_obj() -> Self::ObjectT

Create a new sentinel entity object.

Source

fn on_push_prev( self, prev: Self, alloc: &IDBoundAlloc<Self>, ) -> EntityListRes<Self>

Signal: invoked when this node is being added after prev node.

Source

fn on_push_next( self, next: Self, alloc: &IDBoundAlloc<Self>, ) -> EntityListRes<Self>

Signal: invoked when this node is being added before next node.

Source

fn on_unplug(self, alloc: &IDBoundAlloc<Self>) -> EntityListRes<Self>

Signal: invoked when this node is being unplugged from a list.

Provided Methods§

Source

fn is_sentinel(self, alloc: &IDBoundAlloc<Self>) -> bool

Check if this node ID is a sentinel.

Source

fn new_sentinel(alloc: &IDBoundAlloc<Self>) -> Self

Create a new sentinel node ID allocated from the given allocator.

Source

fn get_prev_id(self, alloc: &IDBoundAlloc<Self>) -> Option<Self>

Get the previous node ID, if any.

Source

fn get_next_id(self, alloc: &IDBoundAlloc<Self>) -> Option<Self>

Get the next node ID, if any.

Source

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.

Implementors§