pub enum Fields {
Named(FieldsNamed),
Unnamed(FieldsUnnamed),
Unit,
}
Available on crate features
full
or derive
only.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.
source§impl<'a> IntoIterator for &'a Fields
impl<'a> IntoIterator for &'a Fields
source§impl<'a> IntoIterator for &'a mut Fields
impl<'a> IntoIterator for &'a mut Fields
source§impl IntoIterator for Fields
impl IntoIterator for Fields
source§impl PartialEq<Fields> for Fields
Available on crate feature extra-traits
only.
impl PartialEq<Fields> for Fields
Available on crate feature
extra-traits
only.source§impl ToTokens for Fields
Available on crate feature printing
only.
impl ToTokens for Fields
Available on crate feature
printing
only.source§fn to_tokens(&self, tokens: &mut TokenStream)
fn to_tokens(&self, tokens: &mut TokenStream)
source§fn to_token_stream(&self) -> TokenStream
fn to_token_stream(&self) -> TokenStream
source§fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
fn into_token_stream(self) -> TokenStreamwhere
Self: Sized,
impl Eq for Fields
Available on crate feature
extra-traits
only.