pub enum PropertyKey<T: PropertyKeyKind> {
Identifier(String, Span, T),
StringLiteral(String, Quoted, Span),
NumberLiteral(NumberRepresentation, Span),
Computed(Box<Expression>, Span),
}Expand description
A key for a member in a class or object literal
Variants§
Identifier(String, Span, T)
StringLiteral(String, Quoted, Span)
NumberLiteral(NumberRepresentation, Span)
Computed(Box<Expression>, Span)
Includes anything in the [...] maybe a symbol
Implementations§
Source§impl<U: PropertyKeyKind> PropertyKey<U>
impl<U: PropertyKeyKind> PropertyKey<U>
pub fn is_private(&self) -> bool
Trait Implementations§
Source§impl<U: PropertyKeyKind> ASTNode for PropertyKey<U>
impl<U: PropertyKeyKind> ASTNode for PropertyKey<U>
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 sourcefn 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 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_readerfn 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<T: Clone + PropertyKeyKind> Clone for PropertyKey<T>
impl<T: Clone + PropertyKeyKind> Clone for PropertyKey<T>
Source§fn clone(&self) -> PropertyKey<T>
fn clone(&self) -> PropertyKey<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 + PropertyKeyKind> Debug for PropertyKey<T>
impl<T: Debug + PropertyKeyKind> Debug for PropertyKey<T>
Source§impl<T: PropertyKeyKind> GetFieldByType<BaseSpan<()>> for PropertyKey<T>
impl<T: PropertyKeyKind> GetFieldByType<BaseSpan<()>> for PropertyKey<T>
Source§impl<U: PropertyKeyKind> PartialEq<str> for PropertyKey<U>
impl<U: PropertyKeyKind> PartialEq<str> for PropertyKey<U>
Source§impl<T: PartialEq + PropertyKeyKind> PartialEq for PropertyKey<T>
impl<T: PartialEq + PropertyKeyKind> PartialEq for PropertyKey<T>
Source§impl<T> SelfRustTokenize for PropertyKey<T>where
T: SelfRustTokenize + PropertyKeyKind,
impl<T> SelfRustTokenize for PropertyKey<T>where
T: SelfRustTokenize + PropertyKeyKind,
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<T> Serialize for PropertyKey<T>where
T: Serialize + PropertyKeyKind,
impl<T> Serialize for PropertyKey<T>where
T: Serialize + PropertyKeyKind,
Source§impl Visitable for PropertyKey<AlwaysPublic>
impl Visitable for PropertyKey<AlwaysPublic>
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>, )
Source§impl Visitable for PropertyKey<PublicOrPrivate>
impl Visitable for PropertyKey<PublicOrPrivate>
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>, )
impl<T: Eq + PropertyKeyKind> Eq for PropertyKey<T>
impl<T: PropertyKeyKind> StructuralPartialEq for PropertyKey<T>
Auto Trait Implementations§
impl<T> Freeze for PropertyKey<T>where
T: Freeze,
impl<T> RefUnwindSafe for PropertyKey<T>where
T: RefUnwindSafe,
impl<T> Send for PropertyKey<T>
impl<T> Sync for PropertyKey<T>
impl<T> Unpin for PropertyKey<T>where
T: Unpin,
impl<T> UnwindSafe for PropertyKey<T>where
T: 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