Skip to main content

IsTruthy

Trait IsTruthy 

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

is_true(x) — polymorphic truthy check. The transpiler emits is_true(&X) where X may be a Value, a bool, or the result of any other predicate (is_equal, in_op, …). This trait lets all of them work without manual conversion at the call site.

Required Methods§

Source

fn truthy(&self) -> bool

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl IsTruthy for &bool

Source§

fn truthy(&self) -> bool

Source§

impl IsTruthy for bool

Source§

fn truthy(&self) -> bool

Implementors§