pub trait ToAddress {
// Provided method
fn code(&self) -> u8 { ... }
}Expand description
Trait for converting tagged enums to their numeric representation.
This trait provides a method to extract the numeric value from enums that use
#[repr(u8)]. It uses unsafe pointer casting to access the discriminant value directly.
§Safety
This trait must ONLY be used on enums with #[repr(u8)] attribute.
Using it on other types will result in undefined behavior.
§Warning
DO NOT use this trait on anything other than #[repr(u8)] enums.