pub enum Fields {
Named(FieldsNamed),
Unnamed(FieldsUnnamed),
Unit,
}
Expand description
Data stored within an enum variant or struct.
This type is available if Syn is built with the "derive"
or "full"
feature.
§Syntax tree enum
This type is a syntax tree enum.
Variants§
Named(FieldsNamed)
Named fields of a struct or struct variant such as Point { x: f64, y: f64 }
.
This type is available if Syn is built with the "derive"
or
"full"
feature.
Unnamed(FieldsUnnamed)
Unnamed fields of a tuple struct or tuple variant such as Some(T)
.
This type is available if Syn is built with the "derive"
or
"full"
feature.
Unit
Unit struct or unit variant such as None
.
Implementations§
Trait Implementations§
Source§impl From<FieldsNamed> for Fields
impl From<FieldsNamed> for Fields
Source§fn from(e: FieldsNamed) -> Fields
fn from(e: FieldsNamed) -> Fields
Converts to this type from the input type.
Source§impl From<FieldsUnnamed> for Fields
impl From<FieldsUnnamed> for Fields
Source§fn from(e: FieldsUnnamed) -> Fields
fn from(e: FieldsUnnamed) -> Fields
Converts to this type from the input type.
Source§impl<'a> IntoIterator for &'a Fields
impl<'a> IntoIterator for &'a Fields
impl Eq for Fields
impl StructuralPartialEq for Fields
Auto Trait Implementations§
impl Freeze for Fields
impl RefUnwindSafe for Fields
impl !Send for Fields
impl !Sync for Fields
impl Unpin for Fields
impl UnwindSafe for Fields
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> Spanned for Twhere
T: ToTokens,
impl<T> Spanned for Twhere
T: ToTokens,
Source§fn span(&self) -> Span
fn span(&self) -> Span
Returns a
Span
covering the complete contents of this syntax tree
node, or Span::call_site()
if this node is empty.