pub enum Predicate {
Contains {
capture: u32,
values: Vec<String>,
},
Ancestor {
capture: u32,
kinds: Vec<String>,
parent: bool,
negative: bool,
},
Offset {
capture: u32,
offsets: [isize; 4],
},
}Expand description
A compiled custom predicate or capture-offset directive.
Variants§
Contains
Require captured text to contain at least one literal.
Fields
Ancestor
Test parent or ancestor node kinds, optionally negating the result.
Fields
Offset
Adjust capture boundaries by row and byte-column offsets.
Implementations§
Source§impl Predicate
impl Predicate
Sourcepub fn compile(operator: &str, arguments: Vec<Argument>) -> Result<Self, Error>
pub fn compile(operator: &str, arguments: Vec<Argument>) -> Result<Self, Error>
Compile a custom-predicate operator and literal arguments.
§Errors
Returns Error::Query for unsupported operators or malformed arguments.
Auto Trait Implementations§
impl Forget for Predicate
impl Freeze for Predicate
impl Move for Predicate
impl RefUnwindSafe for Predicate
impl Send for Predicate
impl Sync for Predicate
impl Unpin for Predicate
impl UnsafeUnpin for Predicate
impl UnwindSafe for Predicate
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