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