Enum syn::Fields [−][src]
pub enum Fields { Named(FieldsNamed), Unnamed(FieldsUnnamed), Unit, }
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 struct or unit variant such as None
.
Implementations
impl Fields
[src]
impl Fields
[src]pub fn iter(&self) -> Iter<'_, Field>ⓘ
[src]
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.
pub fn iter_mut(&mut self) -> IterMut<'_, Field>ⓘ
[src]
Get an iterator over the mutably borrowed Field
items in this
object. This iterator can be used to iterate over a named or unnamed
struct or variant’s fields uniformly.
pub fn len(&self) -> usize
[src]
Returns the number of fields.
pub fn is_empty(&self) -> bool
[src]
Returns true
if there are zero fields.
Trait Implementations
impl Clone for Fields
[src]
impl Clone for Fields
[src]fn clone(&self) -> Self
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl From<FieldsNamed> for Fields
[src]
impl From<FieldsNamed> for Fields
[src]fn from(e: FieldsNamed) -> Fields
[src]
impl From<FieldsUnnamed> for Fields
[src]
impl From<FieldsUnnamed> for Fields
[src]fn from(e: FieldsUnnamed) -> Fields
[src]
impl IntoIterator for Fields
[src]
impl IntoIterator for Fields
[src]impl<'a> IntoIterator for &'a Fields
[src]
impl<'a> IntoIterator for &'a Fields
[src]impl<'a> IntoIterator for &'a mut Fields
[src]
impl<'a> IntoIterator for &'a mut Fields
[src]impl ToTokens for Fields
[src]
impl ToTokens for Fields
[src]