Skip to main content

IEntityRingListNodeID

Trait IEntityRingListNodeID 

Source
pub trait IEntityRingListNodeID: 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_unplug(
        self,
        obj: &Self::ObjectT,
        alloc: &IDBoundAlloc<Self>,
    ) -> EntityListRes<Self>;

    // Provided methods
    fn new_sentinel(alloc: &IDBoundAlloc<Self>) -> Self { ... }
    fn is_sentinel(self, alloc: &IDBoundAlloc<Self>) -> bool { ... }
    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 { ... }
    fn obj_detach(
        obj: &Self::ObjectT,
        alloc: &IDBoundAlloc<Self>,
    ) -> EntityListRes<Self> { ... }
    fn detach(self, alloc: &IDBoundAlloc<Self>) -> EntityListRes<Self> { ... }
}
Expand description

An entity pointer list node that supports ring lists.

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>)

Store the EntityListNodeHead into the entity object. 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_unplug( self, obj: &Self::ObjectT, alloc: &IDBoundAlloc<Self>, ) -> EntityListRes<Self>

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

Provided Methods§

Source

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

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

Source

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

Check if this node ID is a sentinel.

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.

Source

fn obj_detach( obj: &Self::ObjectT, alloc: &IDBoundAlloc<Self>, ) -> EntityListRes<Self>

Detach the given node from its current ring list.

Source

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

Detach this node from the ring list it is currently attached to.

§Signal invocation

detach will invoke on_unplug on self before modifying any links. If the signal returns an error, the operation is aborted without modifying any links.

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§