pub struct Query { /* private fields */ }Implementations§
Source§impl Query
impl Query
pub fn builder() -> QueryBuilder
Sourcepub fn check(&self) -> Result<(), QueryError>
pub fn check(&self) -> Result<(), QueryError>
A query has to ask something: one read from JSON may not.
pub fn pattern(pattern: impl Into<String>) -> Self
pub fn of_kind(kind: impl Into<String>) -> Self
pub fn of_symbol(symbol: SymbolKind) -> Self
pub fn named(name: impl Into<String>) -> Self
pub fn with_kind(self, kind: impl Into<String>) -> Self
pub fn with_symbol(self, symbol: SymbolKind) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
pub fn in_language(self, language: impl Into<LanguageId>) -> Self
pub fn pattern_str(&self) -> Option<&str>
pub fn kind_str(&self) -> Option<&str>
pub fn symbol(&self) -> Option<SymbolKind>
pub fn name(&self) -> Option<&str>
pub fn language(&self) -> Option<&LanguageId>
Sourcepub fn is_structural(&self) -> bool
pub fn is_structural(&self) -> bool
True when the query selects nodes structurally (pattern or kind).
Sourcepub fn is_symbolic(&self) -> bool
pub fn is_symbolic(&self) -> bool
True when the query filters on declarations (symbol or name).
Sourcepub fn literals(&self) -> Vec<&str>
pub fn literals(&self) -> Vec<&str>
Words every match must contain as whole tokens: the identifier- and number-like runs of the pattern that are not meta-variables, and the symbol name. A file whose text lacks any of them cannot match, so a search may skip it without parsing. Empty for a kind-only query.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Query
impl<'de> Deserialize<'de> for Query
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Query
impl StructuralPartialEq for Query
Auto Trait Implementations§
impl Freeze for Query
impl RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin for Query
impl UnsafeUnpin for Query
impl UnwindSafe for Query
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more