Skip to main content

Bool

Trait Bool 

Source
pub trait Bool {
    // Required method
    fn to_bool() -> bool;
}
Expand description

Marker trait for type-level booleans.

§Examples

use reflect_nat::{True, False, Bool};

fn require_bool<B: Bool>() -> bool { B::to_bool() }
assert!(require_bool::<True>());
assert!(!require_bool::<False>());

Required Methods§

Source

fn to_bool() -> bool

The runtime bool value of this type-level boolean.

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.

Implementors§