pub trait UnitEnum: Copy + Sized {
// Required methods
fn to_byte(self) -> u8;
fn from_byte(byte: u8) -> Option<Self>;
}Expand description
A fieldless enum with a one-byte representation. Implemented by
#[hopper::unit_enum]; hand-written impls must keep from_byte the
exact inverse of to_byte on every variant.
Required Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".