Struct syn_solidity::ItemContract
source · pub struct ItemContract {
pub attrs: Vec<Attribute>,
pub kind: ContractKind,
pub name: SolIdent,
pub inheritance: Option<Inheritance>,
pub brace_token: Brace,
pub body: Vec<Item>,
}
Expand description
A contract, abstract contract, interface, or library definition:
contract Foo is Bar("foo"), Baz { ... }
.
Solidity reference: https://docs.soliditylang.org/en/latest/grammar.html#a4.SolidityParser.contractDefinition
Fields§
§attrs: Vec<Attribute>
§kind: ContractKind
§name: SolIdent
§inheritance: Option<Inheritance>
§brace_token: Brace
§body: Vec<Item>
Implementations§
source§impl ItemContract
impl ItemContract
pub fn as_type(&self) -> Type
sourcepub fn is_abstract_contract(&self) -> bool
pub fn is_abstract_contract(&self) -> bool
Returns true if self
is an abstract contract.
sourcepub fn is_contract(&self) -> bool
pub fn is_contract(&self) -> bool
Returns true if self
is a contract.
sourcepub fn is_interface(&self) -> bool
pub fn is_interface(&self) -> bool
Returns true if self
is an interface.
sourcepub fn is_library(&self) -> bool
pub fn is_library(&self) -> bool
Returns true if self
is a library.
Trait Implementations§
source§impl Clone for ItemContract
impl Clone for ItemContract
source§fn clone(&self) -> ItemContract
fn clone(&self) -> ItemContract
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 ItemContract
impl Debug for ItemContract
source§impl Display for ItemContract
impl Display for ItemContract
source§impl Parse for ItemContract
impl Parse for ItemContract
fn parse(input: ParseStream<'_>) -> Result<Self>
source§impl Spanned for ItemContract
impl Spanned for ItemContract
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.Auto Trait Implementations§
impl RefUnwindSafe for ItemContract
impl !Send for ItemContract
impl !Sync for ItemContract
impl Unpin for ItemContract
impl UnwindSafe for ItemContract
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