pub enum SourceUnitPart {
Show 13 variants
PragmaDirective(Box<PragmaDirective>),
ImportDirective(Import),
ContractDefinition(Box<ContractDefinition>),
EnumDefinition(Box<EnumDefinition>),
StructDefinition(Box<StructDefinition>),
EventDefinition(Box<EventDefinition>),
ErrorDefinition(Box<ErrorDefinition>),
FunctionDefinition(Box<FunctionDefinition>),
VariableDefinition(Box<VariableDefinition>),
TypeDefinition(Box<TypeDefinition>),
Annotation(Box<Annotation>),
Using(Box<Using>),
StraySemicolon(Loc),
}Expand description
A parse tree part.
Variants§
PragmaDirective(Box<PragmaDirective>)
A pragma directive.
pragma <1> <2>;
1 and 2 are None only if an error occurred during parsing.
ImportDirective(Import)
An import directive.
ContractDefinition(Box<ContractDefinition>)
A contract definition.
EnumDefinition(Box<EnumDefinition>)
An enum definition.
StructDefinition(Box<StructDefinition>)
A struct definition.
EventDefinition(Box<EventDefinition>)
An event definition.
ErrorDefinition(Box<ErrorDefinition>)
An error definition.
FunctionDefinition(Box<FunctionDefinition>)
A function definition.
VariableDefinition(Box<VariableDefinition>)
A variable definition.
TypeDefinition(Box<TypeDefinition>)
A type definition.
Annotation(Box<Annotation>)
An annotation.
Using(Box<Using>)
A using directive.
StraySemicolon(Loc)
A stray semicolon.
Trait Implementations§
Source§impl Clone for SourceUnitPart
impl Clone for SourceUnitPart
Source§fn clone(&self) -> SourceUnitPart
fn clone(&self) -> SourceUnitPart
Returns a duplicate 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 CodeLocation for SourceUnitPart
impl CodeLocation for SourceUnitPart
Source§impl Debug for SourceUnitPart
impl Debug for SourceUnitPart
Source§impl Display for SourceUnitPart
impl Display for SourceUnitPart
Source§impl PartialEq for SourceUnitPart
impl PartialEq for SourceUnitPart
impl Eq for SourceUnitPart
impl StructuralPartialEq for SourceUnitPart
Auto Trait Implementations§
impl Freeze for SourceUnitPart
impl RefUnwindSafe for SourceUnitPart
impl Send for SourceUnitPart
impl Sync for SourceUnitPart
impl Unpin for SourceUnitPart
impl UnwindSafe for SourceUnitPart
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§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>
Converts
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>
Converts
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