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

Object Safety§

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