pub enum NodeLibrarySingleDefinition {
LetDefinition {
variable_name: WithMetaData<String>,
type_annotation: Option<WithMetaData<NodeTypeAnnotation>>,
expression: WithMetaData<NodeFullExpression>,
},
TypeDefinition(WithMetaData<NodeTypeNameIdentifier>, Option<Vec<WithMetaData<NodeTypeAlternativeClause>>>),
}
Expand description
NodeLibrarySingleDefinition represents a library single definition node in the AST It can either be a LetDefinition or a TypeDefinition
Variants§
LetDefinition
Represents a let definition
Example: let x = y;
Fields
§
variable_name: WithMetaData<String>
§
type_annotation: Option<WithMetaData<NodeTypeAnnotation>>
§
expression: WithMetaData<NodeFullExpression>
TypeDefinition(WithMetaData<NodeTypeNameIdentifier>, Option<Vec<WithMetaData<NodeTypeAlternativeClause>>>)
Represents a type definition
Example: type x = y;
Trait Implementations§
Source§impl AstVisitor for NodeLibrarySingleDefinition
impl AstVisitor for NodeLibrarySingleDefinition
fn visit( &self, emitter: &mut dyn AstConverting, ) -> Result<TraversalResult, String>
Source§impl Clone for NodeLibrarySingleDefinition
impl Clone for NodeLibrarySingleDefinition
Source§fn clone(&self) -> NodeLibrarySingleDefinition
fn clone(&self) -> NodeLibrarySingleDefinition
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 NodeLibrarySingleDefinition
impl Debug for NodeLibrarySingleDefinition
Source§impl PartialOrd for NodeLibrarySingleDefinition
impl PartialOrd for NodeLibrarySingleDefinition
impl Eq for NodeLibrarySingleDefinition
impl StructuralPartialEq for NodeLibrarySingleDefinition
Auto Trait Implementations§
impl Freeze for NodeLibrarySingleDefinition
impl RefUnwindSafe for NodeLibrarySingleDefinition
impl Send for NodeLibrarySingleDefinition
impl Sync for NodeLibrarySingleDefinition
impl Unpin for NodeLibrarySingleDefinition
impl UnwindSafe for NodeLibrarySingleDefinition
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