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§
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>>
Implementations on Foreign Types§
Source§impl EnumVariant for Variant
impl EnumVariant for Variant
Source§fn type_mut(&mut self) -> Result<&mut Type>
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>
fn type_(&self) -> Result<&Type>
Returns the type of the enum variant, if the variant contains only a single unnamed field.