Skip to main content

AssignmentTargetPropertyIdentifier

Struct AssignmentTargetPropertyIdentifier 

Source
#[non_exhaustive]
#[repr(C)]
pub struct AssignmentTargetPropertyIdentifier<'a> { pub span: Span, pub node_id: Cell<NodeId>, pub binding: IdentifierReference<'a>, pub init: Option<Expression<'a>>, }
Expand description

foo in ({ foo } = obj);

Represents an assignment target property identifier, which includes a binding, and an optional init expression.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§span: Span§node_id: Cell<NodeId>§binding: IdentifierReference<'a>§init: Option<Expression<'a>>

Implementations§

Source§

impl<'a> AssignmentTargetPropertyIdentifier<'a>

Source

pub fn new( span: Span, binding: IdentifierReference<'a>, init: Option<Expression<'a>>, builder: &impl GetAstBuilder<'a>, ) -> AssignmentTargetPropertyIdentifier<'a>

Build an AssignmentTargetPropertyIdentifier.

If you want the built node to be allocated in the memory arena, use AssignmentTargetPropertyIdentifier::boxed instead.

§Parameters
  • span: The Span covering this node
  • binding
  • init
Source

pub fn boxed( span: Span, binding: IdentifierReference<'a>, init: Option<Expression<'a>>, builder: &impl GetAstBuilder<'a>, ) -> Box<'a, AssignmentTargetPropertyIdentifier<'a>>

Build an AssignmentTargetPropertyIdentifier, and store it in the memory arena.

Returns a Box containing the newly-allocated node. If you want a stack-allocated node, use AssignmentTargetPropertyIdentifier::new instead.

§Parameters
  • span: The Span covering this node
  • binding
  • init
Source§

impl AssignmentTargetPropertyIdentifier<'_>

Source

pub fn node_id(&self) -> NodeId

Get NodeId of AssignmentTargetPropertyIdentifier.

Only use this method on a post-semantic AST where NodeIds are always defined.

Source

pub fn set_node_id(&self, node_id: NodeId)

Trait Implementations§

Source§

impl<'new_alloc> CloneIn<'new_alloc> for AssignmentTargetPropertyIdentifier<'_>

Source§

type Cloned = AssignmentTargetPropertyIdentifier<'new_alloc>

The type of the cloned object. Read more
Source§

fn clone_in_impl( &self, with_semantic_ids: CloneInSemanticIds, allocator: &'new_alloc Allocator, ) -> <AssignmentTargetPropertyIdentifier<'_> as CloneIn<'new_alloc>>::Cloned

Clone self into allocator, threading whether semantic ids should be preserved as a runtime with_semantic_ids flag rather than as two separate methods. Read more
Source§

fn clone_in(&self, allocator: &'new_alloc Allocator) -> Self::Cloned

Clone self into the given allocator. allocator may be the same one that self is already in.
Source§

fn clone_in_with_semantic_ids( &self, allocator: &'new_alloc Allocator, ) -> Self::Cloned

Almost identical as clone_in, but for some special type, it will also clone the semantic ids. Please use this method only if you make sure semantic info is synced with the ast node.
Source§

impl ContentEq for AssignmentTargetPropertyIdentifier<'_>

Source§

fn content_eq(&self, other: &AssignmentTargetPropertyIdentifier<'_>) -> bool

This method tests for contents of self and other to be equal.
Source§

fn content_ne(&self, other: &Self) -> bool

This method tests for contents of self and other not to be equal. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a> Debug for AssignmentTargetPropertyIdentifier<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'a> Dummy<'a> for AssignmentTargetPropertyIdentifier<'a>

Source§

fn dummy(allocator: &'a Allocator) -> AssignmentTargetPropertyIdentifier<'a>

Create a dummy AssignmentTargetPropertyIdentifier.

Does not allocate any data into arena.

Source§

impl Gen for AssignmentTargetPropertyIdentifier<'_>

Source§

fn gen(&self, p: &mut Codegen<'_>, ctx: Context)

Generate code for an AST node.
Source§

fn print(&self, p: &mut Codegen<'_>, ctx: Context)

Generate code for an AST node. Alias for gen.
Source§

impl GetNodeId for AssignmentTargetPropertyIdentifier<'_>

Source§

fn node_id(&self) -> NodeId

Get the NodeId for an AST node.
Source§

impl GetSpan for AssignmentTargetPropertyIdentifier<'_>

Source§

fn span(&self) -> Span

Get the Span for an AST node.
Source§

impl GetSpanMut for AssignmentTargetPropertyIdentifier<'_>

Source§

fn span_mut(&mut self) -> &mut Span

Get a mutable reference to an AST node’s Span.
Source§

impl<'a> ReplaceWith<'a> for AssignmentTargetPropertyIdentifier<'a>

Source§

fn replace_with(&mut self, replacer: impl FnOnce(Self) -> Self)

Replace the node in place with the value returned by replacer. Read more
Source§

impl<'a> TakeIn<'a> for AssignmentTargetPropertyIdentifier<'a>

Source§

fn take_in(&mut self, allocator_accessor: &impl GetAllocator<'a>) -> Self

Replace node with a dummy, and return the original. Read more
Source§

fn take_in_box( &mut self, allocator_accessor: &impl GetAllocator<'a>, ) -> Box<'a, Self>

Replace node with a dummy, allocate the original node into the arena, and return it as a Box<Self>. Read more
Source§

impl UnstableAddress for AssignmentTargetPropertyIdentifier<'_>

Source§

fn unstable_address(&self) -> Address

Get the memory Address of a reference to an AST node in arena, which is not necessarily stable. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<'a, T> FromIn<'a, T> for T

Source§

fn from_in(t: T, _: &'a Allocator) -> T

Converts to this type from the input type within the given allocator.
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<'a, T, U> IntoIn<'a, U> for T
where U: FromIn<'a, T>,

Source§

fn into_in(self, allocator: &'a Allocator) -> U

Converts this type into the (usually inferred) input type within the given allocator.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.