pub struct EnumConfig {Show 13 fields
pub rename_variants: Option<RenameRule>,
pub add_sentinel: bool,
pub prefix_with_name: bool,
pub derive_helper_methods: bool,
pub derive_const_casts: bool,
pub derive_mut_casts: bool,
pub cast_assert_name: Option<String>,
pub must_use: Option<String>,
pub derive_tagged_enum_destructor: bool,
pub derive_tagged_enum_copy_constructor: bool,
pub derive_tagged_enum_copy_assignment: bool,
pub enum_class: bool,
pub private_default_tagged_enum_constructor: bool,
}Expand description
Settings to apply to generated enums.
Fields§
§rename_variants: Option<RenameRule>The rename rule to apply to the name of enum variants
add_sentinel: boolWhether to add a Sentinel value at the end of every enum
This is useful in Gecko for IPC serialization
prefix_with_name: boolWhether the enum variants should be prefixed with the enum name
derive_helper_methods: boolWhether to generate static ::X(..) constructors and IsX()
methods for tagged enums.
derive_const_casts: boolWhether to generate AsX() const methods for tagged enums.
derive_mut_casts: boolWhether to generate AsX() methods for tagged enums.
cast_assert_name: Option<String>The name of the macro to use for derive_{const,mut}casts. If custom, you’re
responsible to provide the necessary header, otherwise assert will be
used, and <cassert> will be included.
must_use: Option<String>The way to annotation this enum as #[must_use].
derive_tagged_enum_destructor: boolWhether to generate destructors of tagged enums.
derive_tagged_enum_copy_constructor: boolWhether to generate copy-constructors of tagged enums.
derive_tagged_enum_copy_assignment: boolWhether to generate copy-assignment operators of tagged enums.
This is only generated if a copy constructor for the same tagged enum is generated as well.
enum_class: boolDeclare the enum as an enum class. Only relevant when targeting C++.
private_default_tagged_enum_constructor: boolWhether to generate empty, private default-constructors for tagged enums.
Trait Implementations§
Source§impl Clone for EnumConfig
impl Clone for EnumConfig
Source§fn clone(&self) -> EnumConfig
fn clone(&self) -> EnumConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more