pub enum Constraint<'a> {
Extension(&'a str),
Glob(&'a str),
Parts(&'a [&'a str]),
Text(&'a str),
Exclude(&'a [&'a str]),
PathSegment(&'a str),
FilePath(&'a str),
FileType(&'a str),
GitStatus(GitStatusFilter),
Not(Box<Constraint<'a>>),
}Expand description
Constraint types that can be extracted from a query
Variants§
Extension(&'a str)
Match file extension: *.rs -> Extension(“rs”)
Glob(&'a str)
Glob pattern: /*.rs -> Glob(“/*.rs”)
Parts(&'a [&'a str])
Multiple text search parts: [“src”, “name”] Uses slice to avoid allocation
Text(&'a str)
Single text token (optimized case)
Exclude(&'a [&'a str])
Exclude pattern: !test -> Exclude(&[“test”])
PathSegment(&'a str)
Path constraint: /src/ -> PathSegment(“src”)
FilePath(&'a str)
File path constraint (AI mode): “libswscale/input.c” → FilePath(“libswscale/input.c”)
Matches files whose relative path ends with this suffix at a / boundary.
FileType(&'a str)
File type constraint: type:rust -> FileType(“rust”)
GitStatus(GitStatusFilter)
Git status constraint: status:modified -> GitStatus(Modified)
Not(Box<Constraint<'a>>)
Negation constraint: !extension:rs -> Not(Extension(“rs”)) Negates the inner constraint
Trait Implementations§
Source§impl<'a> Clone for Constraint<'a>
impl<'a> Clone for Constraint<'a>
Source§fn clone(&self) -> Constraint<'a>
fn clone(&self) -> Constraint<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for Constraint<'a>
impl<'a> Debug for Constraint<'a>
Source§impl<'a> PartialEq for Constraint<'a>
impl<'a> PartialEq for Constraint<'a>
impl<'a> Eq for Constraint<'a>
impl<'a> StructuralPartialEq for Constraint<'a>
Auto Trait Implementations§
impl<'a> Freeze for Constraint<'a>
impl<'a> RefUnwindSafe for Constraint<'a>
impl<'a> Send for Constraint<'a>
impl<'a> Sync for Constraint<'a>
impl<'a> Unpin for Constraint<'a>
impl<'a> UnsafeUnpin for Constraint<'a>
impl<'a> UnwindSafe for Constraint<'a>
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