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 Freeze for ItemContract
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)