pub struct ObjectDestructureField<'a, T> {
pub field_name: Spanned<'a>,
pub binding: Option<SpannedLvalue<'a, T>>,
}
Expand description
Single field in ObjectDestructure
, such as x
and y: new_y
in { x, y: new_y }
.
In addition to the “ordinary” field: lvalue
syntax for a field with binding,
an alternative one is supported: field -> lvalue
. This makes the case
of a field with type annotation easier to recognize (for humans); field -> lvalue: Type
is
arguably more readable than field: lvalue: Type
(although the latter is still valid syntax).
Fields§
§field_name: Spanned<'a>
Field name, such as xs
in xs: (x, ...tail)
.
binding: Option<SpannedLvalue<'a, T>>
Binding for the field, such as (x, ...tail)
in xs: (x, ...tail)
.
Trait Implementations§
source§impl<'a, T: Clone> Clone for ObjectDestructureField<'a, T>
impl<'a, T: Clone> Clone for ObjectDestructureField<'a, T>
source§fn clone(&self) -> ObjectDestructureField<'a, T>
fn clone(&self) -> ObjectDestructureField<'a, 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<'a, T: Debug> Debug for ObjectDestructureField<'a, T>
impl<'a, T: Debug> Debug for ObjectDestructureField<'a, T>
source§impl<'a, T: PartialEq> PartialEq for ObjectDestructureField<'a, T>
impl<'a, T: PartialEq> PartialEq for ObjectDestructureField<'a, T>
source§fn eq(&self, other: &ObjectDestructureField<'a, T>) -> bool
fn eq(&self, other: &ObjectDestructureField<'a, T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a, T> StructuralPartialEq for ObjectDestructureField<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for ObjectDestructureField<'a, T>where
T: Freeze,
impl<'a, T> RefUnwindSafe for ObjectDestructureField<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for ObjectDestructureField<'a, T>where
T: Send,
impl<'a, T> Sync for ObjectDestructureField<'a, T>where
T: Sync,
impl<'a, T> Unpin for ObjectDestructureField<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for ObjectDestructureField<'a, 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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)