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§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>
impl<'a, T: PartialEq> StructuralPartialEq for ObjectDestructureField<'a, T>
Auto Trait Implementations§
impl<'a, T> Freeze for ObjectDestructureField<'a, T>
impl<'a, T> RefUnwindSafe for ObjectDestructureField<'a, T>
impl<'a, T> Send for ObjectDestructureField<'a, T>
impl<'a, T> Sync for ObjectDestructureField<'a, T>
impl<'a, T> Unpin for ObjectDestructureField<'a, T>
impl<'a, T> UnsafeUnpin for ObjectDestructureField<'a, T>
impl<'a, T> UnwindSafe for ObjectDestructureField<'a, T>
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