pub struct StaticDefinitions<'a, Q: QueryContext> {
pub skippable_indexes: Vec<usize>,
/* private fields */
}
Expand description
Static information used for a pattern This is useful for static analysis of patterns without running the query engine.
Fields§
§skippable_indexes: Vec<usize>
Pattern indexes we should skip during analysis (before_each_file / after_each_file)
Implementations§
Source§impl<'a, Q: QueryContext> StaticDefinitions<'a, Q>
impl<'a, Q: QueryContext> StaticDefinitions<'a, Q>
pub fn new( pattern_definitions: &'a [PatternDefinition<Q>], predicate_definitions: &'a [PredicateDefinition<Q>], function_definitions: &'a [GritFunctionDefinition<Q>], ) -> Self
pub fn get_pattern(&self, index: usize) -> Option<&PatternDefinition<Q>>
pub fn get_predicate(&self, index: usize) -> Option<&PredicateDefinition<Q>>
pub fn get_function(&self, index: usize) -> Option<&GritFunctionDefinition<Q>>
Trait Implementations§
Source§impl<'a, Q: Debug + QueryContext> Debug for StaticDefinitions<'a, Q>
impl<'a, Q: Debug + QueryContext> Debug for StaticDefinitions<'a, Q>
Source§impl<'a, Q: QueryContext> Default for StaticDefinitions<'a, Q>
impl<'a, Q: QueryContext> Default for StaticDefinitions<'a, Q>
Auto Trait Implementations§
impl<'a, Q> Freeze for StaticDefinitions<'a, Q>
impl<'a, Q> RefUnwindSafe for StaticDefinitions<'a, Q>where
<Q as QueryContext>::LeafNodePattern: RefUnwindSafe,
<Q as QueryContext>::CodeSnippet: RefUnwindSafe,
<Q as QueryContext>::NodePattern: RefUnwindSafe,
impl<'a, Q> Send for StaticDefinitions<'a, Q>where
<Q as QueryContext>::LeafNodePattern: Sync,
<Q as QueryContext>::CodeSnippet: Sync,
<Q as QueryContext>::NodePattern: Sync,
impl<'a, Q> Sync for StaticDefinitions<'a, Q>where
<Q as QueryContext>::LeafNodePattern: Sync,
<Q as QueryContext>::CodeSnippet: Sync,
<Q as QueryContext>::NodePattern: Sync,
impl<'a, Q> Unpin for StaticDefinitions<'a, Q>
impl<'a, Q> UnwindSafe for StaticDefinitions<'a, Q>where
<Q as QueryContext>::LeafNodePattern: RefUnwindSafe,
<Q as QueryContext>::CodeSnippet: RefUnwindSafe,
<Q as QueryContext>::NodePattern: 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> 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