Skip to main content

Crate amql_selector

Crate amql_selector 

Source
Expand description

Structural selector parser and matcher for annotation trees.

Re-exports§

pub use selector::Combinator;
pub use selector::CompoundSelector;
pub use selector::SelectorAst;

Modules§

selector
Structural selector parser.

Structs§

AttrName
Attribute key in metadata maps.
Predicate
A predicate expression: name, name=value, name^=value, etc.
TagName
Annotation or code element tag name.

Enums§

PredicateOp
Comparison operator.
PredicateValue
Typed predicate value.

Traits§

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

Functions§

filter_by_selector
Filter an array of flat nodes by a selector AST. Returns indices into the input slice for matched nodes.
filter_by_selector_indexed
Filter nodes using parent indices for combinator matching. parent_indices[i] is the index of node i’s parent in nodes, or None.
matches_compound
Test if a single node matches a compound selector (tag + attributes).
parse_selector
Parse a CSS-like AQL selector string and return the AST.

Type Aliases§

AttrOp
Alias for PredicateOp (backwards compatibility).
AttrPredicate
Alias for Predicate (backwards compatibility).