BoolLike

Trait BoolLike 

Source
pub trait BoolLike {
    // Required method
    fn as_bool(&self) -> bool;
}
Expand description

A trait for types that can be interpreted as a bool.

Primitive numerical types (integers and floats) implement this trait, so you don’t have to implement this by yourself. However, you could implement it for your own custom type, if you want.

We don’t use num crate because it is overkill for our purposes.

Required Methods§

Source

fn as_bool(&self) -> bool

Implementations on Foreign Types§

Source§

impl BoolLike for bool

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for f32

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for f64

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for i8

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for i16

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for i32

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for i64

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for i128

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for u8

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for u16

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for u32

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for u64

Source§

fn as_bool(&self) -> bool

Source§

impl BoolLike for u128

Source§

fn as_bool(&self) -> bool

Implementors§