pub enum VariableDeclaration {
ConstDeclaration {
keyword: Keyword<Const>,
declarations: Vec<VariableDeclarationItem<Expression>>,
},
LetDeclaration {
keyword: Keyword<Let>,
declarations: Vec<VariableDeclarationItem<Option<Expression>>>,
},
}
Expand description
TODO smallvec the declarations
Variants§
Implementations§
source§impl VariableDeclaration
impl VariableDeclaration
pub fn is_constant(&self) -> bool
Trait Implementations§
source§impl ASTNode for VariableDeclaration
impl ASTNode for VariableDeclaration
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 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
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 Clone for VariableDeclaration
impl Clone for VariableDeclaration
source§fn clone(&self) -> VariableDeclaration
fn clone(&self) -> VariableDeclaration
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 VariableDeclaration
impl Debug for VariableDeclaration
source§impl From<VariableDeclaration> for Declaration
impl From<VariableDeclaration> for Declaration
source§fn from(item: VariableDeclaration) -> Declaration
fn from(item: VariableDeclaration) -> Declaration
Converts to this type from the input type.
source§impl PartialEq<VariableDeclaration> for VariableDeclaration
impl PartialEq<VariableDeclaration> for VariableDeclaration
source§fn eq(&self, other: &VariableDeclaration) -> bool
fn eq(&self, other: &VariableDeclaration) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl SelfRustTokenize for VariableDeclaration
impl SelfRustTokenize for VariableDeclaration
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<'try_into_ref> TryInto<&'try_into_ref VariableDeclaration> for &'try_into_ref Declaration
impl<'try_into_ref> TryInto<&'try_into_ref VariableDeclaration> for &'try_into_ref Declaration
§type Error = &'try_into_ref Declaration
type Error = &'try_into_ref Declaration
The type returned in the event of a conversion error.
source§impl<'try_into_ref> TryInto<&'try_into_ref mut VariableDeclaration> for &'try_into_ref mut Declaration
impl<'try_into_ref> TryInto<&'try_into_ref mut VariableDeclaration> for &'try_into_ref mut Declaration
§type Error = &'try_into_ref mut Declaration
type Error = &'try_into_ref mut Declaration
The type returned in the event of a conversion error.
source§impl Visitable for VariableDeclaration
impl Visitable for VariableDeclaration
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 Eq for VariableDeclaration
impl StructuralEq for VariableDeclaration
impl StructuralPartialEq for VariableDeclaration
Auto Trait Implementations§
impl RefUnwindSafe for VariableDeclaration
impl Send for VariableDeclaration
impl Sync for VariableDeclaration
impl Unpin for VariableDeclaration
impl UnwindSafe for VariableDeclaration
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