#[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>
impl<'a> AssignmentTargetPropertyIdentifier<'a>
Sourcepub fn new(
span: Span,
binding: IdentifierReference<'a>,
init: Option<Expression<'a>>,
builder: &impl GetAstBuilder<'a>,
) -> AssignmentTargetPropertyIdentifier<'a>
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: TheSpancovering this nodebindinginit
Sourcepub fn boxed(
span: Span,
binding: IdentifierReference<'a>,
init: Option<Expression<'a>>,
builder: &impl GetAstBuilder<'a>,
) -> Box<'a, AssignmentTargetPropertyIdentifier<'a>>
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: TheSpancovering this nodebindinginit
Source§impl AssignmentTargetPropertyIdentifier<'_>
impl AssignmentTargetPropertyIdentifier<'_>
Sourcepub fn node_id(&self) -> NodeId
pub fn node_id(&self) -> NodeId
Get NodeId of AssignmentTargetPropertyIdentifier.
Only use this method on a post-semantic AST where NodeIds are always defined.
Sourcepub fn set_node_id(&self, node_id: NodeId)
pub fn set_node_id(&self, node_id: NodeId)
Trait Implementations§
Source§impl<'new_alloc> CloneIn<'new_alloc> for AssignmentTargetPropertyIdentifier<'_>
impl<'new_alloc> CloneIn<'new_alloc> for AssignmentTargetPropertyIdentifier<'_>
Source§type Cloned = AssignmentTargetPropertyIdentifier<'new_alloc>
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
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 moreSource§fn clone_in(&self, allocator: &'new_alloc Allocator) -> Self::Cloned
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
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<'_>
impl ContentEq for AssignmentTargetPropertyIdentifier<'_>
Source§fn content_eq(&self, other: &AssignmentTargetPropertyIdentifier<'_>) -> bool
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
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>
impl<'a> Debug for AssignmentTargetPropertyIdentifier<'a>
Source§impl<'a> Dummy<'a> for AssignmentTargetPropertyIdentifier<'a>
impl<'a> Dummy<'a> for AssignmentTargetPropertyIdentifier<'a>
Source§fn dummy(allocator: &'a Allocator) -> AssignmentTargetPropertyIdentifier<'a>
fn dummy(allocator: &'a Allocator) -> AssignmentTargetPropertyIdentifier<'a>
Create a dummy AssignmentTargetPropertyIdentifier.
Does not allocate any data into arena.
Source§impl Gen for AssignmentTargetPropertyIdentifier<'_>
impl Gen for AssignmentTargetPropertyIdentifier<'_>
Source§impl GetNodeId for AssignmentTargetPropertyIdentifier<'_>
impl GetNodeId for AssignmentTargetPropertyIdentifier<'_>
Source§impl GetSpan for AssignmentTargetPropertyIdentifier<'_>
impl GetSpan for AssignmentTargetPropertyIdentifier<'_>
Source§impl GetSpanMut for AssignmentTargetPropertyIdentifier<'_>
impl GetSpanMut for AssignmentTargetPropertyIdentifier<'_>
Source§impl<'a> ReplaceWith<'a> for AssignmentTargetPropertyIdentifier<'a>
impl<'a> ReplaceWith<'a> for AssignmentTargetPropertyIdentifier<'a>
Source§fn replace_with(&mut self, replacer: impl FnOnce(Self) -> Self)
fn replace_with(&mut self, replacer: impl FnOnce(Self) -> Self)
Replace the node in place with the value returned by
replacer. Read moreSource§impl<'a> TakeIn<'a> for AssignmentTargetPropertyIdentifier<'a>
impl<'a> TakeIn<'a> for AssignmentTargetPropertyIdentifier<'a>
Source§fn take_in(&mut self, allocator_accessor: &impl GetAllocator<'a>) -> Self
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>
fn take_in_box( &mut self, allocator_accessor: &impl GetAllocator<'a>, ) -> Box<'a, Self>
Source§impl UnstableAddress for AssignmentTargetPropertyIdentifier<'_>
impl UnstableAddress for AssignmentTargetPropertyIdentifier<'_>
Auto Trait Implementations§
impl<'a> !Freeze for AssignmentTargetPropertyIdentifier<'a>
impl<'a> !RefUnwindSafe for AssignmentTargetPropertyIdentifier<'a>
impl<'a> !Send for AssignmentTargetPropertyIdentifier<'a>
impl<'a> !Sync for AssignmentTargetPropertyIdentifier<'a>
impl<'a> !UnwindSafe for AssignmentTargetPropertyIdentifier<'a>
impl<'a> Forget for AssignmentTargetPropertyIdentifier<'a>
impl<'a> Move for AssignmentTargetPropertyIdentifier<'a>
impl<'a> Unpin for AssignmentTargetPropertyIdentifier<'a>
impl<'a> UnsafeUnpin for AssignmentTargetPropertyIdentifier<'a>
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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