Skip to main content

Matchable

Trait Matchable 

Source
pub trait Matchable {
    // Required methods
    fn tag(&self) -> &TagName;
    fn attrs(&self) -> &HashMap<AttrName, Value, FxBuildHasher>;
    fn parent(&self) -> Option<&dyn Matchable>;
}
Expand description

A matchable node — works for both annotations and code elements.

Required Methods§

Source

fn tag(&self) -> &TagName

The element’s tag name (e.g. “function”, “controller”).

Source

fn attrs(&self) -> &HashMap<AttrName, Value, FxBuildHasher>

Key-value attributes on this node.

Source

fn parent(&self) -> Option<&dyn Matchable>

Parent node, if any, for combinator matching.

Implementors§