abi_stable::sabi_types::bitarray

Trait BooleanEnum

Source
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§

Source

const FALSE: Self

The falsy value of this type

Source

const TRUE: Self

The truthy value of this type

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.

Implementations on Foreign Types§

Source§

impl BooleanEnum for bool

Source§

const FALSE: Self = false

Source§

const TRUE: Self = true

Implementors§

Source§

impl BooleanEnum for IsAccessible

Source§

const FALSE: Self = Self::No

Source§

const TRUE: Self = Self::Yes

Source§

impl BooleanEnum for IsConditional

Source§

const FALSE: Self = Self::No

Source§

const TRUE: Self = Self::Yes