NodeWithMetadata

Trait NodeWithMetadata 

Source
pub trait NodeWithMetadata<M: NodeMetadata> {
    // Required method
    fn metadata(&self) -> M;

    // Provided method
    fn self_metadata(&self) -> 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). Default implementation merges children’s metadata with self_metadata().

Provided Methods§

Source

fn self_metadata(&self) -> M

Returns the metadata contributed by this node itself, not including children. Most nodes don’t contribute metadata, so can simply return M::default(). Nodes like StyleRule or AtRules should return their own node kind flags here.

Implementations on Foreign Types§

Source§

impl<M: NodeMetadata, T: NodeWithMetadata<M>> NodeWithMetadata<M> for Option<T>

Source§

fn self_metadata(&self) -> M

Source§

fn metadata(&self) -> M

Implementors§

Source§

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

Source§

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

Source§

impl<'a, D, M: NodeMetadata> NodeWithMetadata<M> for UnknownRuleBlock<'a, D, M>

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<D, M: NodeMetadata> NodeWithMetadata<M> for NoBlockAllowed<D, M>