pub unsafe trait BooleanEnum:
Debug
+ Copy
+ 'static {
const FALSE: Self;
const TRUE: Self;
}
Expand description
A trait for enums with two variants where one is truthy
and the other one is falsy
.
§Safety
This type must:
- be represented as a
u8
- have exactly two possible values
- assign one value to the
FALSE
associated constant, - assign another value to the
TRUE
associated constant
Required Associated Constants§
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.