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, ®ular_node);
schedule_node(&mut scheduler, &exclusive_node);
schedule_node(&mut scheduler, &raw_handle);