pub struct CompiledQuery { /* private fields */ }Expand description
A Query with every regular expression it needs compiled up front.
The string/type pattern, a fuzzy class pattern and a member name used as a
regex are compiled here; a member name matched as a substring (precise
class) or exactly (exact_name) is kept as the plain string. Empty patterns are kept as “no
constraint” exactly as FindRefs::locate
treats them.
Implementations§
Source§impl CompiledQuery
impl CompiledQuery
Sourcepub fn new(q: &Query) -> Result<CompiledQuery, FindError>
pub fn new(q: &Query) -> Result<CompiledQuery, FindError>
Compile q.
§Errors
FindError::Pattern when one of its patterns is not a valid regex;
FindError::Invalid for a Query::Nested or an override: /
in: predicate the engine has not resolved yet, and for a compound
query with an empty all, a nested compound, or a class relation
among its parts.
Sourcepub fn kind(&self) -> RefKind
pub fn kind(&self) -> RefKind
The index table the query targets (see Query::kind).
Sourcepub fn relation(&self) -> Option<ClassRelation>
pub fn relation(&self) -> Option<ClassRelation>
The class relation an Extends / Implements query asks for.
Sourcepub fn compound(&self) -> Option<&Compound>
pub fn compound(&self) -> Option<&Compound>
The parts of a compound query (Query::All).
Sourcepub fn defined(&self) -> Option<&Defined>
pub fn defined(&self) -> Option<&Defined>
The resolved method-definition predicate of a Query::Defined.