pub enum Fields {
Named(FieldsNamed),
Unnamed(FieldsUnnamed),
Unit,
}
Expand description
Data stored within an enum variant or struct.
This type is available only 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 }
.
Unnamed(FieldsUnnamed)
Unnamed fields of a tuple struct or tuple variant such as Some(T)
.
Unit
Unit struct or unit variant such as None
.
Implementations§
source§impl Fields
impl Fields
sourcepub fn iter(&self) -> Iter<'_, Field> ⓘ
pub fn iter(&self) -> Iter<'_, Field> ⓘ
Get an iterator over the borrowed Field
items in this object. This
iterator can be used to iterate over a named or unnamed struct or
variant’s fields uniformly.
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.