NodeMetadata

Trait NodeMetadata 

Source
pub trait NodeMetadata:
    Sized
    + Copy
    + Default {
    // Required method
    fn merge(self, other: Self) -> Self;

    // Provided method
    fn with_size(self, _size: u16) -> Self { ... }
}
Expand description

Aggregated metadata for nodes, that can propagate up a node tree.

Required Methods§

Source

fn merge(self, other: Self) -> Self

Merges another NodeMetadata into this one, returning the result.

Provided Methods§

Source

fn with_size(self, _size: u16) -> Self

Sets the size of this metadata (e.g., number of declarations, selector list length). Default implementation is a no-op for metadata types that don’t track size.

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.

Implementations on Foreign Types§

Source§

impl NodeMetadata for ()

Source§

fn merge(self, _: Self) -> Self

Implementors§