Struct ezno_parser::declarations::variable::VariableDeclarationItem
source · pub struct VariableDeclarationItem<TExpr: DeclarationExpression> {
pub name: WithComment<VariableField<VariableFieldInSourceCode>>,
pub type_annotation: Option<TypeAnnotation>,
pub expression: TExpr,
}
Expand description
Represents a name =
Fields§
§name: WithComment<VariableField<VariableFieldInSourceCode>>
§type_annotation: Option<TypeAnnotation>
§expression: TExpr
Trait Implementations§
source§impl<TExpr: DeclarationExpression + 'static> ASTNode for VariableDeclarationItem<TExpr>
impl<TExpr: DeclarationExpression + 'static> ASTNode for VariableDeclarationItem<TExpr>
source§fn get_position(&self) -> Cow<'_, Span>
fn get_position(&self) -> Cow<'_, Span>
Returns position of node as span AS IT WAS PARSED. May be none if AST was doesn’t match anything in source
fn from_reader( reader: &mut impl TokenReader<TSXToken, Span>, state: &mut ParsingState, settings: &ParseOptions ) -> ParseResult<Self>
fn to_string_from_buffer<T: ToString>( &self, buf: &mut T, settings: &ToStringOptions, depth: u8 )
source§fn from_string(
source: String,
settings: ParseOptions,
source_id: SourceId,
offset: Option<usize>,
cursors: Vec<(usize, EmptyCursorId)>
) -> ParseResult<Self>
fn from_string( source: String, settings: ParseOptions, source_id: SourceId, offset: Option<usize>, cursors: Vec<(usize, EmptyCursorId)> ) -> ParseResult<Self>
From string, with default impl to call abstract method from_reader
source§fn to_string(&self, settings: &ToStringOptions) -> String
fn to_string(&self, settings: &ToStringOptions) -> String
Returns structure as valid string
source§impl<TExpr: Clone + DeclarationExpression> Clone for VariableDeclarationItem<TExpr>
impl<TExpr: Clone + DeclarationExpression> Clone for VariableDeclarationItem<TExpr>
source§fn clone(&self) -> VariableDeclarationItem<TExpr>
fn clone(&self) -> VariableDeclarationItem<TExpr>
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<TExpr: Debug + DeclarationExpression> Debug for VariableDeclarationItem<TExpr>
impl<TExpr: Debug + DeclarationExpression> Debug for VariableDeclarationItem<TExpr>
source§impl<TExpr: PartialEq + DeclarationExpression> PartialEq<VariableDeclarationItem<TExpr>> for VariableDeclarationItem<TExpr>
impl<TExpr: PartialEq + DeclarationExpression> PartialEq<VariableDeclarationItem<TExpr>> for VariableDeclarationItem<TExpr>
source§fn eq(&self, other: &VariableDeclarationItem<TExpr>) -> bool
fn eq(&self, other: &VariableDeclarationItem<TExpr>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl<TExpr> SelfRustTokenize for VariableDeclarationItem<TExpr>where
TExpr: SelfRustTokenize + DeclarationExpression,
impl<TExpr> SelfRustTokenize for VariableDeclarationItem<TExpr>where TExpr: SelfRustTokenize + DeclarationExpression,
fn append_to_token_stream(&self, token_stream: &mut TokenStream)
source§fn to_tokens(&self) -> TokenStream
fn to_tokens(&self) -> TokenStream
Returns the tokens used to construct self
source§impl<TExpr> Visitable for VariableDeclarationItem<TExpr>where
TExpr: Visitable + DeclarationExpression,
impl<TExpr> Visitable for VariableDeclarationItem<TExpr>where TExpr: Visitable + DeclarationExpression,
fn visit<TData>( &self, visitors: &mut (impl VisitorReceiver<TData> + ?Sized), data: &mut TData, settings: &VisitSettings, chain: &mut Annex<'_, Chain> )
fn visit_mut<TData>( &mut self, visitors: &mut (impl VisitorMutReceiver<TData> + ?Sized), data: &mut TData, settings: &VisitSettings, chain: &mut Annex<'_, Chain> )
impl<TExpr: Eq + DeclarationExpression> Eq for VariableDeclarationItem<TExpr>
impl<TExpr: DeclarationExpression> StructuralEq for VariableDeclarationItem<TExpr>
impl<TExpr: DeclarationExpression> StructuralPartialEq for VariableDeclarationItem<TExpr>
Auto Trait Implementations§
impl<TExpr> RefUnwindSafe for VariableDeclarationItem<TExpr>where TExpr: RefUnwindSafe,
impl<TExpr> Send for VariableDeclarationItem<TExpr>
impl<TExpr> Sync for VariableDeclarationItem<TExpr>
impl<TExpr> Unpin for VariableDeclarationItem<TExpr>where TExpr: Unpin,
impl<TExpr> UnwindSafe for VariableDeclarationItem<TExpr>where TExpr: UnwindSafe,
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