pub struct VariableDefinition {
pub loc: Loc,
pub ty: Expression,
pub attrs: Vec<VariableAttribute>,
pub name: Option<Identifier>,
pub initializer: Option<Expression>,
}Expand description
A variable definition.
<ty> <attrs>* <name> [= <initializer>]
Fields§
§loc: LocThe code location.
ty: ExpressionThe type.
attrs: Vec<VariableAttribute>The list of variable attributes.
name: Option<Identifier>The identifier.
This field is None only if an error occurred during parsing.
initializer: Option<Expression>The optional initializer.
Trait Implementations§
Source§impl Clone for VariableDefinition
impl Clone for VariableDefinition
Source§fn clone(&self) -> VariableDefinition
fn clone(&self) -> VariableDefinition
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 CodeLocation for VariableDefinition
impl CodeLocation for VariableDefinition
Source§impl Debug for VariableDefinition
impl Debug for VariableDefinition
Source§impl Display for VariableDefinition
impl Display for VariableDefinition
Source§impl PartialEq for VariableDefinition
impl PartialEq for VariableDefinition
impl Eq for VariableDefinition
impl StructuralPartialEq for VariableDefinition
Auto Trait Implementations§
impl Freeze for VariableDefinition
impl RefUnwindSafe for VariableDefinition
impl Send for VariableDefinition
impl Sync for VariableDefinition
impl Unpin for VariableDefinition
impl UnwindSafe for VariableDefinition
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