pub struct VariableDeclarationItem<TExpr: DeclarationExpression> {
pub name: WithComment<VariableField>,
pub type_annotation: Option<TypeAnnotation>,
pub expression: TExpr,
pub position: Span,
}
Expand description
Represents a name =
Fields§
§name: WithComment<VariableField>
§type_annotation: Option<TypeAnnotation>
§expression: TExpr
§position: Span
Trait Implementations§
Source§impl<TExpr: DeclarationExpression + 'static> ASTNode for VariableDeclarationItem<TExpr>
impl<TExpr: DeclarationExpression + 'static> ASTNode for VariableDeclarationItem<TExpr>
fn from_reader( reader: &mut impl TokenReader<TSXToken, TokenStart>, state: &mut ParsingState, options: &ParseOptions, ) -> ParseResult<Self>
fn to_string_from_buffer<T: ToString>( &self, buf: &mut T, options: &ToStringOptions, local: LocalToStringInformation, )
Source§fn get_position(&self) -> Span
fn get_position(&self) -> Span
Returns position of node as span AS IT WAS PARSED. May be
Span::NULL
if AST was doesn’t match anything in sourceSource§fn from_string(script: String, options: ParseOptions) -> ParseResult<Self>
fn from_string(script: String, options: ParseOptions) -> ParseResult<Self>
From string, with default impl to call abstract method
from_reader
fn from_string_with_options( script: String, options: ParseOptions, offset: Option<u32>, ) -> ParseResult<(Self, ParsingState)>
Source§fn to_string(&self, options: &ToStringOptions) -> String
fn to_string(&self, options: &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: DeclarationExpression> GetFieldByType<BaseSpan<()>> for VariableDeclarationItem<TExpr>
impl<TExpr: DeclarationExpression> GetFieldByType<BaseSpan<()>> for VariableDeclarationItem<TExpr>
Source§impl<TExpr> PartialEq for VariableDeclarationItem<TExpr>where
TExpr: PartialEq + DeclarationExpression,
impl<TExpr> PartialEq for VariableDeclarationItem<TExpr>where
TExpr: PartialEq + DeclarationExpression,
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> Serialize for VariableDeclarationItem<TExpr>where
TExpr: Serialize + DeclarationExpression,
impl<TExpr> Serialize for VariableDeclarationItem<TExpr>where
TExpr: Serialize + DeclarationExpression,
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, options: &VisitOptions, chain: &mut Annex<'_, Chain>, )
fn visit_mut<TData>( &mut self, visitors: &mut (impl VisitorMutReceiver<TData> + ?Sized), data: &mut TData, options: &VisitOptions, chain: &mut Annex<'_, Chain>, )
Auto Trait Implementations§
impl<TExpr> Freeze for VariableDeclarationItem<TExpr>where
TExpr: Freeze,
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