repr-discriminant 2.0.1

Trait to retrieve the discriminant of an enum variant with a repr(T) at runtime
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! A library to obtain the representation of an enum's discriminant.

/// A trait to obtain the representation of an enum's discriminant.
pub trait ReprDiscriminant {
    /// The representation type of the discriminant.
    type Repr;

    /// Returns the representation of the enum's discriminant.
    fn repr_discriminant(&self) -> Self::Repr;
}

#[cfg(feature = "derive")]
pub use repr_discriminant_derive::ReprDiscriminant;