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
Fields
§
variable_name: WithMetaData<String>§
type_annotation: Option<WithMetaData<NodeTypeAnnotation>>§
expression: WithMetaData<NodeFullExpression>Represents a let definition
Example: let x = y;
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 PartialEq for NodeLibrarySingleDefinition
impl PartialEq for NodeLibrarySingleDefinition
source§fn eq(&self, other: &NodeLibrarySingleDefinition) -> bool
fn eq(&self, other: &NodeLibrarySingleDefinition) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl PartialOrd for NodeLibrarySingleDefinition
impl PartialOrd for NodeLibrarySingleDefinition
source§fn partial_cmp(&self, other: &NodeLibrarySingleDefinition) -> Option<Ordering>
fn partial_cmp(&self, other: &NodeLibrarySingleDefinition) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read moreimpl Eq for NodeLibrarySingleDefinition
impl StructuralEq for NodeLibrarySingleDefinition
impl StructuralPartialEq for NodeLibrarySingleDefinition
Auto Trait Implementations§
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