Trait NodeWithMetadata

Source
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§

Source

fn metadata(&self) -> M

Returns the complete aggregated metadata for this node (self + children)

Provided Methods§

Source

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.

Implementors§

Source§

impl<'a, D, R, M> NodeWithMetadata<M> for Block<'a, D, R, M>
where D: DeclarationValue<'a, M>, M: NodeMetadata,

Source§

impl<'a, D, R, M> NodeWithMetadata<M> for DeclarationRuleList<'a, D, R, M>
where D: DeclarationValue<'a, M>, R: NodeWithMetadata<M>, M: NodeMetadata,

Source§

impl<'a, M: NodeMetadata> NodeWithMetadata<M> for BadDeclaration<'a>

Source§

impl<'a, M: NodeMetadata> NodeWithMetadata<M> for ComponentValues<'a>

Source§

impl<'a, P, D, R, M> NodeWithMetadata<M> for QualifiedRule<'a, P, D, R, M>
where D: DeclarationValue<'a, M>, M: NodeMetadata,

Source§

impl<'a, R, M> NodeWithMetadata<M> for RuleList<'a, R, M>

Source§

impl<'a, V, M> NodeWithMetadata<M> for Declaration<'a, V, M>
where V: DeclarationValue<'a, M>, M: NodeMetadata,

Source§

impl<'a, V, M> NodeWithMetadata<M> for DeclarationList<'a, V, M>
where V: DeclarationValue<'a, M>, M: NodeMetadata,

Source§

impl<M: NodeMetadata> NodeWithMetadata<M> for NoBlockAllowed