NodeHandle

Trait NodeHandle 

Source
pub trait NodeHandle {
    // Required methods
    fn index(&self) -> NodeIndex;
    fn depth(&self) -> u32;
    fn mut_epoch(&self) -> usize;
}
Expand description

Common interface for accessing node metadata regardless of ownership model.

NodeHandle provides a unified way to access core node properties (index, depth, mut_epoch) across different node types including Node<T>, ExclusiveNode<T>, and RawHandle. This abstraction allows code to work generically with node metadata without caring about the specific ownership or access patterns.

§Example

fn schedule_node<H: NodeHandle>(scheduler: &mut Scheduler, handle: &H) {
    scheduler.schedule(handle.index(), handle.depth());
}

// Works with any node type
schedule_node(&mut scheduler, &regular_node);
schedule_node(&mut scheduler, &exclusive_node);
schedule_node(&mut scheduler, &raw_handle);

Required Methods§

Source

fn index(&self) -> NodeIndex

Source

fn depth(&self) -> u32

Source

fn mut_epoch(&self) -> usize

Implementors§

Source§

impl NodeHandle for RawHandle

Source§

impl<T: 'static> NodeHandle for ExclusiveNode<T>

Source§

impl<T: 'static> NodeHandle for Node<T>