pub enum Variable {
Identifier(Identifier),
Field(Box<FieldExpression>),
Index(Box<IndexExpression>),
}Expand description
Represents a variable reference.
Variants§
Identifier(Identifier)
A simple named variable (e.g., x, count, self).
Field(Box<FieldExpression>)
A field access on a table or object using dot notation (e.g., table.field, self.name).
Index(Box<IndexExpression>)
An index access on a table using bracket notation (e.g., array[1], table[key]).
Implementations§
Source§impl Variable
impl Variable
Sourcepub fn mutate_first_token(&mut self) -> &mut Token
pub fn mutate_first_token(&mut self) -> &mut Token
Returns a mutable reference to the first token for this variable, creating it if missing.
Sourcepub fn mutate_last_token(&mut self) -> &mut Token
pub fn mutate_last_token(&mut self) -> &mut Token
Returns a mutable reference to the last token for this variable, creating it if missing.
Trait Implementations§
Source§impl From<FieldExpression> for Variable
impl From<FieldExpression> for Variable
Source§fn from(field: FieldExpression) -> Self
fn from(field: FieldExpression) -> Self
Converts to this type from the input type.
Source§impl From<Identifier> for Variable
impl From<Identifier> for Variable
Source§fn from(identifier: Identifier) -> Self
fn from(identifier: Identifier) -> Self
Converts to this type from the input type.
Source§impl From<IndexExpression> for Variable
impl From<IndexExpression> for Variable
Source§fn from(index: IndexExpression) -> Self
fn from(index: IndexExpression) -> Self
Converts to this type from the input type.
Source§impl From<Variable> for Expression
impl From<Variable> for Expression
impl Eq for Variable
impl StructuralPartialEq for Variable
Auto Trait Implementations§
impl Freeze for Variable
impl RefUnwindSafe for Variable
impl Send for Variable
impl Sync for Variable
impl Unpin for Variable
impl UnwindSafe for Variable
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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