type_reflect 0.6.2

Extensible runtime reflection through a Derive macro
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use type_reflect_core::{
    type_description::{EnumCase, EnumType},
    Inflection,
};

/// A type implementing `EnumReflectionType` can
/// be used to emit a enum representation
pub trait EnumReflectionType {
    fn name() -> &'static str;
    fn inflection() -> Inflection;
    fn cases() -> Vec<EnumCase>;
    fn enum_type() -> EnumType;
    fn rust() -> String;
}