pub struct FieldInit {
pub matching_source: Fragment,
pub name: Identifier,
pub value: Expr,
pub shorthand: bool,
}Available on crate feature
ast-models only.Expand description
A field initializer in a RecordLiteral, such as the x: 1 in Point { x: 1 }.
Fields§
§matching_source: FragmentThe source of this field initializer.
name: IdentifierThe name of the field.
value: ExprThe value of the field. For shorthand initializers (Point { x }) this is a path expression referring to the
variable with the same name as the field.
shorthand: boolWas this written using the shorthand Point { x } syntax?
Trait Implementations§
Source§impl AstNode for FieldInit
impl AstNode for FieldInit
Source§fn matching_source(&self) -> &Fragment
fn matching_source(&self) -> &Fragment
Get the Fragment of source code this node was parsed from.
impl StructuralPartialEq for FieldInit
Auto Trait Implementations§
impl Forget for FieldInit
impl Freeze for FieldInit
impl RefUnwindSafe for FieldInit
impl Send for FieldInit
impl Sync for FieldInit
impl Unpin for FieldInit
impl UnsafeUnpin for FieldInit
impl UnwindSafe for FieldInit
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§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