Trait NodeRef

Source
pub trait NodeRef:
    Copy
    + Eq
    + Ord
    + Hash
    + Debug
    + Into<NodeId> {
    // Required method
    fn new(id: NodeId) -> Self;

    // Provided method
    fn alloc() -> Self { ... }
}
Expand description

A reference to a node.

Newtypes around NodeId should implement this trait to offer functionality common to all node references.

Required Methods§

Source

fn new(id: NodeId) -> Self

Create a new reference from an existing node ID.

Provided Methods§

Source

fn alloc() -> Self

Allocate a new reference.

Creates a new unique reference. Calls NodeId::alloc() under the hood.

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§