Skip to main content

DListItem

Trait DListItem 

Source
pub unsafe trait DListItem<Tag>: Sized {
    // Required method
    fn get_node(&self) -> &mut DListNode<Self, Tag>;
}
Expand description

A trait to return internal mutable DListNode for specified list.

The tag is used to distinguish different DListNodes within the same item, allowing an item to belong to multiple lists simultaneously. For only one ownership, you can use ().

§Safety

Implementors must ensure get_node returns a valid reference to the DListNode embedded within Self. Users must use UnsafeCell to hold DListNode to support interior mutability required by list operations.

Required Methods§

Source

fn get_node(&self) -> &mut DListNode<Self, Tag>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§