pub struct VariableDeclaration {
pub attrs: Vec<Attribute>,
pub ty: Type,
pub storage: Option<Storage>,
pub name: Option<SolIdent>,
}
Expand description
A variable declaration: string memory hello
.
Fields§
§attrs: Vec<Attribute>
The attributes of the variable.
ty: Type
The type of the variable.
storage: Option<Storage>
The storage location of the variable, if any.
name: Option<SolIdent>
The name of the variable. This is always Some if parsed as part of
Parameters
or a Stmt
.
Implementations§
Source§impl VariableDeclaration
impl VariableDeclaration
pub const fn new(ty: Type) -> Self
pub const fn new_with( ty: Type, storage: Option<Storage>, name: Option<SolIdent>, ) -> Self
Sourcepub fn fmt_eip712(&self, f: &mut impl Write) -> Result
pub fn fmt_eip712(&self, f: &mut impl Write) -> Result
Formats self
as an EIP-712 field: <ty> <name>
pub fn parse_with_name(input: ParseStream<'_>) -> Result<Self>
Trait Implementations§
Source§impl Clone for VariableDeclaration
impl Clone for VariableDeclaration
Source§fn clone(&self) -> VariableDeclaration
fn clone(&self) -> VariableDeclaration
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 Debug for VariableDeclaration
impl Debug for VariableDeclaration
Source§impl Display for VariableDeclaration
impl Display for VariableDeclaration
Source§impl<P: Default> FromIterator<VariableDeclaration> for Parameters<P>
impl<P: Default> FromIterator<VariableDeclaration> for Parameters<P>
Source§fn from_iter<T: IntoIterator<Item = VariableDeclaration>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = VariableDeclaration>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl Hash for VariableDeclaration
impl Hash for VariableDeclaration
Source§impl Parse for VariableDeclaration
impl Parse for VariableDeclaration
fn parse(input: ParseStream<'_>) -> Result<Self>
Source§impl PartialEq for VariableDeclaration
impl PartialEq for VariableDeclaration
Source§impl Spanned for VariableDeclaration
impl Spanned for VariableDeclaration
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.impl Eq for VariableDeclaration
impl StructuralPartialEq for VariableDeclaration
Auto Trait Implementations§
impl Freeze for VariableDeclaration
impl RefUnwindSafe for VariableDeclaration
impl !Send for VariableDeclaration
impl !Sync for VariableDeclaration
impl Unpin for VariableDeclaration
impl UnwindSafe for VariableDeclaration
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