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 duplicate 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
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