pub struct Query {
query: String,
capture: String,
filter: Option<FnPtr>,
}
Expand description
A struct to represent a treesitter query.
Fields§
§query: String
The query to run.
capture: String
The capture to extract from the query.
filter: Option<FnPtr>
A function pointer to filter the matches using. Must return a boolean.
Implementations§
source§impl Query
impl Query
sourcepub fn set_capture(self, capture: String) -> Self
pub fn set_capture(self, capture: String) -> Self
Sets the captures to extract from the query.
sourcepub fn set_filter(self, filter: FnPtr) -> Self
pub fn set_filter(self, filter: FnPtr) -> Self
Set the function to filter the results of the query.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Query
impl Send for Query
impl Sync for Query
impl Unpin 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