pub trait CubeEnum: Sized {
type RuntimeValue: Clone + CubeDebug;
// Required methods
fn discriminant(&self) -> NativeExpand<i32>;
fn runtime_value(self) -> Self::RuntimeValue;
fn discriminant_of(variant_name: &'static str) -> i32;
// Provided method
fn discriminant_of_value(&self, variant_name: &'static str) -> i32 { ... }
}Required Associated Types§
type RuntimeValue: Clone + CubeDebug
Required Methods§
fn discriminant(&self) -> NativeExpand<i32>
Sourcefn runtime_value(self) -> Self::RuntimeValue
fn runtime_value(self) -> Self::RuntimeValue
Return the runtime value of this enum, if only one variant has a value. Should return () for all other cases.
fn discriminant_of(variant_name: &'static str) -> i32
Provided Methods§
fn discriminant_of_value(&self, variant_name: &'static str) -> i32
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.