[][src]Trait core_extensions::type_level_bool::Boolean

pub trait Boolean: Sealed + MarkerType + Default + Sized + Debug + Copy + Clone + BitAnd<True> + BitAnd<False> + BitOr<True> + BitOr<False> + BitXor<True> + BitXor<False> + Not {
    type Not: Boolean<Not = Self>;

    const VALUE: bool;
    fn if_true<U, F: FnOnce() -> U>(_: F) -> Option<U> { ... }
fn if_false<U, F: FnOnce() -> U>(_: F) -> Option<U> { ... } }

Represents a type-level bool

Only implemented on True and False.

For examples look at the module-level documentation.

This trait is sealed and cannot be implemented for types outside this crate.

Associated Types

type Not: Boolean<Not = Self>

The negation of this type.

Loading content...

Associated Constants

const VALUE: bool

The bool value of this type

Loading content...

Provided methods

fn if_true<U, F: FnOnce() -> U>(_: F) -> Option<U>

If Self==True,runs the closure and returns Some , otherwise returns None.

fn if_false<U, F: FnOnce() -> U>(_: F) -> Option<U>

If Self==False,runs the closure and returns Some , otherwise returns None.

Loading content...

Implementors

impl Boolean for False[src]

type Not = True

impl Boolean for True[src]

type Not = False

Loading content...