pub enum VariableSource {
Compiled {
name: String,
file: String,
locations: BTreeSet<ByteRange>,
},
Global {
name: String,
},
}
Expand description
VariableSource is used to track the origin of a variable It can come from
Variants§
Implementations§
Source§impl VariableSource
impl VariableSource
pub fn new(name: String, file: String) -> Self
pub fn new_global(name: String) -> Self
Sourcepub fn register_location(&mut self, location: ByteRange) -> GritResult<()>
pub fn register_location(&mut self, location: ByteRange) -> GritResult<()>
Register a location in a GritQL file where a variable is referenced
Sourcepub fn get_main_locations(&self) -> Vec<ByteRange>
pub fn get_main_locations(&self) -> Vec<ByteRange>
Get locations where the variable is referenced from the main pattern file
Trait Implementations§
Source§impl Clone for VariableSource
impl Clone for VariableSource
Source§fn clone(&self) -> VariableSource
fn clone(&self) -> VariableSource
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 Freeze for VariableSource
impl RefUnwindSafe for VariableSource
impl Send for VariableSource
impl Sync for VariableSource
impl Unpin for VariableSource
impl UnwindSafe for VariableSource
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