EnumVariant

Trait EnumVariant 

Source
pub trait EnumVariant {
    // Required methods
    fn has_single_item(&self) -> bool;
    fn is_unit(&self) -> bool;
    fn type_(&self) -> Result<&Type>;
    fn type_mut(&mut self) -> Result<&mut Type>;
    fn type_path(&self) -> Result<&Path>;
    fn type_path_mut(&mut self) -> Result<&mut Path>;
    fn named_fields(&self) -> Result<&Punctuated<Field, Comma>>;
    fn named_fields_mut(&mut self) -> Result<&mut Punctuated<Field, Comma>>;
    fn unnamed_fields(&self) -> Result<&Punctuated<Field, Comma>>;
    fn unnamed_fields_mut(&mut self) -> Result<&mut Punctuated<Field, Comma>>;
}

Required Methods§

Implementations on Foreign Types§

Source§

impl EnumVariant for Variant

Source§

fn type_mut(&mut self) -> Result<&mut Type>

Returns a mutable ref to the type of the enum variant, if the variant contains only a single unnamed field.

Source§

fn type_(&self) -> Result<&Type>

Returns the type of the enum variant, if the variant contains only a single unnamed field.

Source§

fn has_single_item(&self) -> bool

Source§

fn type_path_mut(&mut self) -> Result<&mut Path>

Source§

fn type_path(&self) -> Result<&Path>

Source§

fn is_unit(&self) -> bool

Source§

fn named_fields(&self) -> Result<&Punctuated<Field, Comma>>

Source§

fn named_fields_mut(&mut self) -> Result<&mut Punctuated<Field, Comma>>

Source§

fn unnamed_fields(&self) -> Result<&Punctuated<Field, Comma>>

Source§

fn unnamed_fields_mut(&mut self) -> Result<&mut Punctuated<Field, Comma>>

Implementors§