pub enum DynamicPattern<Q: QueryContext> {
Variable(Variable),
Accessor(Box<Accessor<Q>>),
ListIndex(Box<ListIndex<Q>>),
Snippet(DynamicSnippet),
List(DynamicList<Q>),
CallBuiltIn(CallBuiltIn<Q>),
CallFunction(CallFunction<Q>),
CallForeignFunction(CallForeignFunction<Q>),
}
Variants§
Variable(Variable)
Accessor(Box<Accessor<Q>>)
ListIndex(Box<ListIndex<Q>>)
Snippet(DynamicSnippet)
List(DynamicList<Q>)
CallBuiltIn(CallBuiltIn<Q>)
CallFunction(CallFunction<Q>)
CallForeignFunction(CallForeignFunction<Q>)
Implementations§
Source§impl<Q: QueryContext> DynamicPattern<Q>
impl<Q: QueryContext> DynamicPattern<Q>
pub fn text<'a>( &'a self, state: &mut State<'a, Q>, context: &'a Q::ExecContext<'a>, logs: &mut AnalysisLogs, ) -> GritResult<String>
Sourcepub fn from_str_constant(s: &str) -> GritResult<Self>
pub fn from_str_constant(s: &str) -> GritResult<Self>
Create a constant DynamicPattern from a string.
Trait Implementations§
Source§impl<Q: Clone + QueryContext> Clone for DynamicPattern<Q>
impl<Q: Clone + QueryContext> Clone for DynamicPattern<Q>
Source§fn clone(&self) -> DynamicPattern<Q>
fn clone(&self) -> DynamicPattern<Q>
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<Q: Debug + QueryContext> Debug for DynamicPattern<Q>
impl<Q: Debug + QueryContext> Debug for DynamicPattern<Q>
Source§impl<Q: QueryContext> Matcher<Q> for DynamicPattern<Q>
impl<Q: QueryContext> Matcher<Q> for DynamicPattern<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 DynamicPattern<Q>
impl<Q: QueryContext> PatternName for DynamicPattern<Q>
Auto Trait Implementations§
impl<Q> Freeze for DynamicPattern<Q>
impl<Q> RefUnwindSafe for DynamicPattern<Q>where
<Q as QueryContext>::LeafNodePattern: RefUnwindSafe,
<Q as QueryContext>::CodeSnippet: RefUnwindSafe,
<Q as QueryContext>::NodePattern: RefUnwindSafe,
impl<Q> Send for DynamicPattern<Q>where
<Q as QueryContext>::LeafNodePattern: Send,
<Q as QueryContext>::CodeSnippet: Send,
<Q as QueryContext>::NodePattern: Send,
impl<Q> Sync for DynamicPattern<Q>where
<Q as QueryContext>::LeafNodePattern: Sync,
<Q as QueryContext>::CodeSnippet: Sync,
<Q as QueryContext>::NodePattern: Sync,
impl<Q> Unpin for DynamicPattern<Q>
impl<Q> UnwindSafe for DynamicPattern<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