Skip to main content

BoolUtils

Trait BoolUtils 

Source
pub trait BoolUtils {
    // Required methods
    fn toggle(&mut self);
    fn select<T>(self, on_true: T, on_false: T) -> T;
}
Expand description

A trait that extends boolean values with additional utility methods.

Required Methods§

Source

fn toggle(&mut self)

Toggles the boolean value.

Source

fn select<T>(self, on_true: T, on_false: T) -> T

Selects between two values based on the boolean value.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl BoolUtils for bool

Source§

fn toggle(&mut self)

Source§

fn select<T>(self, on_true: T, on_false: T) -> T

Implementors§