Trait core_extensions::type_level_bool::Boolean [−][src]
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
Associated Constants
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.