BoolType

Trait BoolType 

Source
pub trait BoolType: Copy {
    // Required method
    fn bool_(self) -> bool;
}
Expand description

A trait for types that can be converted to a boolean value.

This trait is implemented for bool and &bool, allowing for a consistent interface to obtain a boolean value from these types.

Required Methods§

Source

fn bool_(self) -> bool

Converts the implementing type to a boolean value.

§Returns

A bool representing the boolean value of the implementing type.

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.

Implementations on Foreign Types§

Source§

impl BoolType for &bool

Source§

fn bool_(self) -> bool

Source§

impl BoolType for bool

Source§

fn bool_(self) -> bool

Implementors§