pub trait NodeHandle<N = Node>: Clone {
const TAG: OpTag;
// Required method
fn node(&self) -> N;
// Provided methods
fn tag(&self) -> OpTag { ... }
fn try_cast<T: NodeHandle<N> + From<N>>(&self) -> Option<T> { ... }
fn can_hold(tag: OpTag) -> bool { ... }
}
Expand description
Common trait for handles to a node.
Typically wrappers around Node
.
Required Associated Constants§
Required Methods§
Provided Methods§
Sourcefn try_cast<T: NodeHandle<N> + From<N>>(&self) -> Option<T>
fn try_cast<T: NodeHandle<N> + From<N>>(&self) -> Option<T>
Cast the handle to a different more general tag.
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.