[][src]Struct cbindgen::EnumConfig

pub struct EnumConfig {
    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>,
}

Settings to apply to generated enums.

Fields

rename_variants: Option<RenameRule>

The rename rule to apply to the name of enum variants

add_sentinel: bool

Whether to add a Sentinel value at the end of every enum This is useful in Gecko for IPC serialization

prefix_with_name: bool

Whether the enum variants should be prefixed with the enum name

derive_helper_methods: bool

Whether to generate static ::X(..) constructors and IsX() methods for tagged enums.

derive_const_casts: bool

Whether to generate AsX() const methods for tagged enums.

derive_mut_casts: bool

Whether 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.

Trait Implementations

impl Default for EnumConfig[src]

impl Clone for EnumConfig[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for EnumConfig[src]

impl<'de> Deserialize<'de> for EnumConfig where
    EnumConfig: Default
[src]

Auto Trait Implementations

impl Send for EnumConfig

impl Sync for EnumConfig

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]