Enum ezno_parser::ast::VariableField
source · pub enum VariableField<T: VariableFieldTypes> {
Name(VariableIdentifier),
Array(Vec<ArrayDestructuringField<T>>, Span),
Object(Vec<WithComment<ObjectDestructuringField<T>>>, Span),
}
Expand description
A variable declaration name, used in variable declarations and function parameters. See destructuring
Variants§
Name(VariableIdentifier)
x
Array(Vec<ArrayDestructuringField<T>>, Span)
[x, y, z]
Object(Vec<WithComment<ObjectDestructuringField<T>>>, Span)
{ x, y: z }
.
Implementations§
source§impl<T: VariableFieldTypes> VariableField<T>
impl<T: VariableFieldTypes> VariableField<T>
pub fn try_get_id(&self) -> Option<VariableId>
Trait Implementations§
source§impl<U: VariableFieldTypes> ASTNode for VariableField<U>
impl<U: VariableFieldTypes> ASTNode for VariableField<U>
fn from_reader( reader: &mut impl TokenReader<TSXToken, Span>, state: &mut ParsingState, settings: &ParseSettings ) -> ParseResult<Self>
fn to_string_from_buffer<T: ToString>( &self, buf: &mut T, settings: &ToStringSettingsAndData, 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: ParseSettings,
source_id: SourceId,
offset: Option<usize>,
cursors: Vec<(usize, EmptyCursorId)>
) -> ParseResult<ParseOutput<Self>>
fn from_string( source: String, settings: ParseSettings, source_id: SourceId, offset: Option<usize>, cursors: Vec<(usize, EmptyCursorId)> ) -> ParseResult<ParseOutput<Self>>
From string, with default impl to call abstract method from_reader
source§fn to_string(&self, settings: &ToStringSettingsAndData) -> String
fn to_string(&self, settings: &ToStringSettingsAndData) -> String
Returns structure as valid string
source§impl<T: Clone + VariableFieldTypes> Clone for VariableField<T>
impl<T: Clone + VariableFieldTypes> Clone for VariableField<T>
source§fn clone(&self) -> VariableField<T>
fn clone(&self) -> VariableField<T>
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<T: Debug + VariableFieldTypes> Debug for VariableField<T>
impl<T: Debug + VariableFieldTypes> Debug for VariableField<T>
source§impl<T: VariableFieldTypes> From<VariableIdentifier> for VariableField<T>
impl<T: VariableFieldTypes> From<VariableIdentifier> for VariableField<T>
source§fn from(value: VariableIdentifier) -> Self
fn from(value: VariableIdentifier) -> Self
Converts to this type from the input type.
source§impl<T: VariableFieldTypes + PartialEq> PartialEq<VariableField<T>> for VariableField<T>
impl<T: VariableFieldTypes + PartialEq> PartialEq<VariableField<T>> for VariableField<T>
source§impl<T: VariableFieldTypes> SelfRustTokenize for VariableField<T>where
T::OptionalExpression: SelfRustTokenize,
impl<T: VariableFieldTypes> SelfRustTokenize for VariableField<T>where T::OptionalExpression: SelfRustTokenize,
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