Struct solang_parser::pt::VariableDefinition
source · 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: Loc
The code location.
ty: Expression
The 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 copy 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
source§fn eq(&self, other: &VariableDefinition) -> bool
fn eq(&self, other: &VariableDefinition) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.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> 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