[][src]Struct darling::ast::Fields

pub struct Fields<T> {
    pub style: Style,
    pub fields: Vec<T, Global>,
    // some fields omitted
}

Equivalent to syn::Fields, but replaces the AST element with a generic.

Fields

style: Stylefields: Vec<T, Global>

Implementations

impl<T> Fields<T>[src]

pub fn new(style: Style, fields: Vec<T, Global>) -> Fields<T>[src]

Creates a new Fields struct.

pub fn with_span(self, span: Span) -> Fields<T>[src]

Adds a Span to Fields.

pub fn empty_from(vd: &Fields) -> Fields<T>[src]

pub fn split(self) -> (Style, Vec<T, Global>)[src]

Splits the Fields into its style and fields for further processing. Returns an empty Vec for Unit data.

pub fn is_newtype(&self) -> bool[src]

Returns true if this variant's data makes it a newtype.

pub fn is_unit(&self) -> bool[src]

pub fn is_tuple(&self) -> bool[src]

pub fn is_struct(&self) -> bool[src]

pub fn as_ref(&'a self) -> Fields<&'a T>[src]

pub fn map<F, U>(self, map: F) -> Fields<U> where
    F: FnMut(T) -> U, 
[src]

pub fn iter(&self) -> Iter<'_, T>[src]

pub fn len(&self) -> usize[src]

Returns the number of fields in the structure.

pub fn is_empty(&self) -> bool[src]

Returns true if the Fields contains no fields.

impl<F> Fields<F> where
    F: FromField
[src]

pub fn try_from(fields: &Fields) -> Result<Fields<F>, Error>[src]

Trait Implementations

impl<T> Clone for Fields<T> where
    T: Clone
[src]

impl<T> Debug for Fields<T> where
    T: Debug
[src]

impl<T> Eq for Fields<T> where
    T: Eq
[src]

impl<T, U> From<(Style, U)> for Fields<T> where
    U: Into<Vec<T, Global>>, 
[src]

impl<T> From<Style> for Fields<T>[src]

impl<T> IntoIterator for Fields<T>[src]

type Item = T

The type of the elements being iterated over.

type IntoIter = IntoIter<T, Global>

Which kind of iterator are we turning this into?

impl<T> PartialEq<Fields<T>> for Fields<T> where
    T: PartialEq<T>, 
[src]

impl<T> ToTokens for Fields<T> where
    T: ToTokens
[src]

impl<T> UsesLifetimes for Fields<T> where
    T: UsesLifetimes
[src]

impl<T> UsesTypeParams for Fields<T> where
    T: UsesTypeParams
[src]

Auto Trait Implementations

impl<T> !RefUnwindSafe for Fields<T>

impl<T> !Send for Fields<T>

impl<T> !Sync for Fields<T>

impl<T> Unpin for Fields<T> where
    T: Unpin

impl<T> UnwindSafe for Fields<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'i, I, T> CollectLifetimes for T where
    I: 'i + UsesLifetimes,
    T: IntoIterator<Item = &'i I>, 
[src]

impl<'i, T, I> CollectTypeParams for T where
    I: 'i + UsesTypeParams,
    T: IntoIterator<Item = &'i I>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Spanned for T where
    T: Spanned + ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.