pub enum Item {
Contract(ItemContract),
Enum(ItemEnum),
Error(ItemError),
Event(ItemEvent),
Function(ItemFunction),
Import(ImportDirective),
Pragma(PragmaDirective),
Struct(ItemStruct),
Udt(ItemUdt),
Using(UsingDirective),
Variable(VariableDefinition),
}
Expand description
An AST item. A more expanded version of a Solidity source unit.
Variants§
Contract(ItemContract)
A contract, abstract contract, interface, or library definition:
contract Foo is Bar, Baz { ... }
Enum(ItemEnum)
An enum definition: enum Foo { A, B, C }
Error(ItemError)
An error definition: error Foo(uint256 a, uint256 b);
Event(ItemEvent)
An event definition: event Transfer(address indexed from, address indexed to, uint256 value);
Function(ItemFunction)
A function, constructor, fallback, receive, or modifier definition:
function helloWorld() external pure returns(string memory);
Import(ImportDirective)
An import directive: import "foo.sol";
Pragma(PragmaDirective)
A pragma directive: pragma solidity ^0.8.0;
Struct(ItemStruct)
A struct definition: struct Foo { uint256 bar; }
Udt(ItemUdt)
A user-defined value type definition: type Foo is uint256;
Using(UsingDirective)
A using
directive: using { A, B.mul as * } for uint256 global;
Variable(VariableDefinition)
A state variable or constant definition: uint256 constant FOO = 42;
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Item
impl RefUnwindSafe for Item
impl !Send for Item
impl !Sync for Item
impl Unpin for Item
impl UnwindSafe for Item
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
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)
clone_to_uninit
)