Struct darling_core::codegen::Variant
[−]
[src]
pub struct Variant<'a> { pub name_in_attr: &'a str, pub variant_ident: &'a Ident, pub ty_ident: &'a Ident, pub data: Fields<Field<'a>>, pub skip: bool, }
An enum variant.
Fields
name_in_attr: &'a str
The name which will appear in code passed to the FromMeta
input.
variant_ident: &'a Ident
The name of the variant which will be returned for a given name_in_attr
.
ty_ident: &'a Ident
The name of the parent enum type.
data: Fields<Field<'a>>
skip: bool
Whether or not the variant should be skipped in the generated code.
Methods
impl<'a> Variant<'a>
[src]
pub fn as_unit_match_arm(&'a self) -> UnitMatchArm<'a>
[src]
pub fn as_data_match_arm(&'a self) -> DataMatchArm<'a>
[src]
Trait Implementations
impl<'a> Debug for Variant<'a>
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl<'a> Clone for Variant<'a>
[src]
fn clone(&self) -> Variant<'a>
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a> PartialEq for Variant<'a>
[src]
fn eq(&self, __arg_0: &Variant<'a>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Variant<'a>) -> bool
[src]
This method tests for !=
.
impl<'a> Eq for Variant<'a>
[src]
impl<'a> UsesTypeParams for Variant<'a>
[src]
fn uses_type_params<'b>(
&self,
options: &Options,
type_set: &'b IdentSet
) -> IdentRefSet<'b>
[src]
&self,
options: &Options,
type_set: &'b IdentSet
) -> IdentRefSet<'b>
Returns the subset of the queried type parameters that are used by the implementing syntax element. Read more