pub trait NodeWithMetadata<M: NodeMetadata> {
// Required method
fn metadata(&self) -> M;
// Provided method
fn self_metadata(&self, initial: M) -> M { ... }
}Expand description
A Node that has NodeMetadata
Required Methods§
Provided Methods§
Sourcefn self_metadata(&self, initial: M) -> M
fn self_metadata(&self, initial: M) -> M
Returns the metadata contributed by this node itself plus and child meta.
Most nodes don’t contribute metadata, so can simply return child.
Other nodes may want to alter the metadata; supplying their own modifications
to initial.