Struct darling::ast::VariantData
[−]
[src]
pub struct VariantData<T> { pub style: Style, pub fields: Vec<T>, }
Fields
style: Style
fields: Vec<T>
Methods
impl<T> VariantData<T>
[src]
fn empty_from(vd: &VariantData) -> VariantData<T>
fn split(self) -> (Style, Vec<T>)
Splits the VariantData
into its style and fields for further processing.
Returns an empty Vec
for Unit
data.
fn is_newtype(&self) -> bool
Returns true if this variant's data makes it a newtype.
fn is_unit(&self) -> bool
fn is_tuple(&self) -> bool
fn is_struct(&self) -> bool
fn as_ref(&'a self) -> VariantData<&'a T>
fn map<F, U>(self, map: F) -> VariantData<U> where
F: FnMut(T) -> U,
F: FnMut(T) -> U,
impl<F> VariantData<F> where
F: FromField,
[src]
F: FromField,
fn try_from(data: &VariantData) -> Result<VariantData<F>, Error>
Trait Implementations
impl<T, U> From<(Style, U)> for VariantData<T> where
U: Into<Vec<T>>,
[src]
U: Into<Vec<T>>,
fn from((Style, U)) -> VariantData<T>
Performs the conversion.
impl<T> From<Style> for VariantData<T>
[src]
fn from(style: Style) -> VariantData<T>
Performs the conversion.
impl<T> Eq for VariantData<T> where
T: Eq,
[src]
T: Eq,
impl<T> PartialEq<VariantData<T>> for VariantData<T> where
T: PartialEq<T>,
[src]
T: PartialEq<T>,
fn eq(&self, __arg_0: &VariantData<T>) -> bool
fn ne(&self, __arg_0: &VariantData<T>) -> bool
impl<T> Debug for VariantData<T> where
T: Debug,
[src]
T: Debug,
impl<T> Clone for VariantData<T> where
T: Clone,
[src]
T: Clone,