pub struct PatternDefinition<Q: QueryContext> {
pub name: String,
/* private fields */
}
Fields§
§name: String
Implementations§
Source§impl<Q: QueryContext> PatternDefinition<Q>
impl<Q: QueryContext> PatternDefinition<Q>
pub fn new( name: String, scope: usize, params: Vec<(String, Variable)>, pattern: Pattern<Q>, ) -> Self
Sourcepub fn new_ephemeral(
params: Vec<(String, Variable)>,
pattern: Pattern<Q>,
) -> Self
pub fn new_ephemeral( params: Vec<(String, Variable)>, pattern: Pattern<Q>, ) -> Self
Create an unnamed ephemeral pattern This is primarily useful for the bubble pattern, where we want to create a new scope
pub fn try_scope(&self) -> GritResult<usize>
pub fn replace_pattern(&mut self, new_pattern: Pattern<Q>)
pub fn params(&self) -> &Vec<(String, Variable)>
pub fn pattern(&self) -> &Pattern<Q>
Trait Implementations§
Source§impl<Q: Clone + QueryContext> Clone for PatternDefinition<Q>
impl<Q: Clone + QueryContext> Clone for PatternDefinition<Q>
Source§fn clone(&self) -> PatternDefinition<Q>
fn clone(&self) -> PatternDefinition<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 moreAuto Trait Implementations§
impl<Q> Freeze for PatternDefinition<Q>
impl<Q> RefUnwindSafe for PatternDefinition<Q>where
<Q as QueryContext>::LeafNodePattern: RefUnwindSafe,
<Q as QueryContext>::CodeSnippet: RefUnwindSafe,
<Q as QueryContext>::NodePattern: RefUnwindSafe,
impl<Q> Send for PatternDefinition<Q>where
<Q as QueryContext>::LeafNodePattern: Send,
<Q as QueryContext>::CodeSnippet: Send,
<Q as QueryContext>::NodePattern: Send,
impl<Q> Sync for PatternDefinition<Q>where
<Q as QueryContext>::LeafNodePattern: Sync,
<Q as QueryContext>::CodeSnippet: Sync,
<Q as QueryContext>::NodePattern: Sync,
impl<Q> Unpin for PatternDefinition<Q>
impl<Q> UnwindSafe for PatternDefinition<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