enutil 0.1.0

General Enum Utility Macros
Documentation
1
2
3
4
5
6
7
8
9
#[cfg(feature = "derive")]
pub use enutil_macros::*;

/// A trait for reducing boilerplate code related to common access patterns in
/// new-type-like variant enums. Because of this, for derived usage, all the
/// variants in the enumerator need to be new-types (e.g. Int(i32), Person(Person))
pub trait EnumDeref: std::ops::Deref + std::ops::DerefMut {}

impl<T: std::ops::Deref + std::ops::DerefMut> EnumDeref for T {}