pub enum Pattern<Q: QueryContext> {
Show 53 variants
AstNode(Box<Q::NodePattern>),
List(Box<List<Q>>),
ListIndex(Box<ListIndex<Q>>),
Map(Box<GritMap<Q>>),
Accessor(Box<Accessor<Q>>),
Call(Box<Call<Q>>),
Regex(Box<RegexPattern<Q>>),
File(Box<FilePattern<Q>>),
Files(Box<Files<Q>>),
Bubble(Box<Bubble<Q>>),
Limit(Box<Limit<Q>>),
CallBuiltIn(Box<CallBuiltIn<Q>>),
CallFunction(Box<CallFunction<Q>>),
CallForeignFunction(Box<CallForeignFunction<Q>>),
CallbackPattern(Box<CallbackPattern>),
Assignment(Box<Assignment<Q>>),
Accumulate(Box<Accumulate<Q>>),
And(Box<And<Q>>),
Or(Box<Or<Q>>),
Maybe(Box<Maybe<Q>>),
Any(Box<Any<Q>>),
Not(Box<Not<Q>>),
If(Box<If<Q>>),
Undefined,
Top,
Bottom,
Underscore,
StringConstant(StringConstant),
AstLeafNode(Q::LeafNodePattern),
IntConstant(IntConstant),
FloatConstant(FloatConstant),
BooleanConstant(BooleanConstant),
Dynamic(DynamicPattern<Q>),
CodeSnippet(Q::CodeSnippet),
Variable(Variable),
Rewrite(Box<Rewrite<Q>>),
Range(Range),
Contains(Box<Contains<Q>>),
Includes(Box<Includes<Q>>),
Within(Box<Within<Q>>),
After(Box<After<Q>>),
Before(Box<Before<Q>>),
Where(Box<Where<Q>>),
Some(Box<Some<Q>>),
Every(Box<Every<Q>>),
Add(Box<Add<Q>>),
Subtract(Box<Subtract<Q>>),
Multiply(Box<Multiply<Q>>),
Divide(Box<Divide<Q>>),
Modulo(Box<Modulo<Q>>),
Dots,
Sequential(Sequential<Q>),
Like(Box<Like<Q>>),
}
Variants§
AstNode(Box<Q::NodePattern>)
List(Box<List<Q>>)
ListIndex(Box<ListIndex<Q>>)
Map(Box<GritMap<Q>>)
Accessor(Box<Accessor<Q>>)
Call(Box<Call<Q>>)
Regex(Box<RegexPattern<Q>>)
File(Box<FilePattern<Q>>)
Files(Box<Files<Q>>)
Bubble(Box<Bubble<Q>>)
Limit(Box<Limit<Q>>)
CallBuiltIn(Box<CallBuiltIn<Q>>)
CallFunction(Box<CallFunction<Q>>)
CallForeignFunction(Box<CallForeignFunction<Q>>)
CallbackPattern(Box<CallbackPattern>)
Assignment(Box<Assignment<Q>>)
Accumulate(Box<Accumulate<Q>>)
And(Box<And<Q>>)
Or(Box<Or<Q>>)
Maybe(Box<Maybe<Q>>)
Any(Box<Any<Q>>)
Not(Box<Not<Q>>)
If(Box<If<Q>>)
Undefined
Top
Bottom
Underscore
StringConstant(StringConstant)
AstLeafNode(Q::LeafNodePattern)
IntConstant(IntConstant)
FloatConstant(FloatConstant)
BooleanConstant(BooleanConstant)
Dynamic(DynamicPattern<Q>)
CodeSnippet(Q::CodeSnippet)
Variable(Variable)
Rewrite(Box<Rewrite<Q>>)
Range(Range)
Contains(Box<Contains<Q>>)
Includes(Box<Includes<Q>>)
Within(Box<Within<Q>>)
After(Box<After<Q>>)
Before(Box<Before<Q>>)
Where(Box<Where<Q>>)
Some(Box<Some<Q>>)
Every(Box<Every<Q>>)
Add(Box<Add<Q>>)
Subtract(Box<Subtract<Q>>)
Multiply(Box<Multiply<Q>>)
Divide(Box<Divide<Q>>)
Modulo(Box<Modulo<Q>>)
Dots
Sequential(Sequential<Q>)
Like(Box<Like<Q>>)
Implementations§
Source§impl<Q: QueryContext> Pattern<Q>
impl<Q: QueryContext> Pattern<Q>
pub fn iter<'a>( &'a self, definitions: &'a StaticDefinitions<'_, Q>, ) -> PatternOrPredicateIterator<'a, Q> ⓘ
Source§impl<Q: QueryContext> Pattern<Q>
impl<Q: QueryContext> Pattern<Q>
pub fn text<'a>( &'a self, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<String>
Trait Implementations§
Source§impl<Q: QueryContext> Matcher<Q> for Pattern<Q>
impl<Q: QueryContext> Matcher<Q> for Pattern<Q>
fn execute<'a>( &'a self, binding: &Q::ResolvedPattern<'a>, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<bool>
Source§impl<Q: QueryContext> PatternName for Pattern<Q>
impl<Q: QueryContext> PatternName for Pattern<Q>
Auto Trait Implementations§
impl<Q> Freeze for Pattern<Q>
impl<Q> RefUnwindSafe for Pattern<Q>where
<Q as QueryContext>::LeafNodePattern: RefUnwindSafe,
<Q as QueryContext>::CodeSnippet: RefUnwindSafe,
<Q as QueryContext>::NodePattern: RefUnwindSafe,
impl<Q> Send for Pattern<Q>where
<Q as QueryContext>::LeafNodePattern: Send,
<Q as QueryContext>::CodeSnippet: Send,
<Q as QueryContext>::NodePattern: Send,
impl<Q> Sync for Pattern<Q>where
<Q as QueryContext>::LeafNodePattern: Sync,
<Q as QueryContext>::CodeSnippet: Sync,
<Q as QueryContext>::NodePattern: Sync,
impl<Q> Unpin for Pattern<Q>
impl<Q> UnwindSafe for Pattern<Q>where
<Q as QueryContext>::LeafNodePattern: UnwindSafe + RefUnwindSafe,
<Q as QueryContext>::CodeSnippet: UnwindSafe + RefUnwindSafe,
<Q as QueryContext>::NodePattern: UnwindSafe + RefUnwindSafe,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more