Skip to main content

Truthy

Trait Truthy 

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

Truthiness for GENERATED code — ONE definition shared with the interpreter’s RuntimeValue::is_truthy and the VM’s Value::is_truthy. Falsy: false, numeric zero (-0.0 is zero; NaN is nonzero and truthy), nothing (None), and empty Text/Seq/Map/Set. Everything else is truthy.

Required Methods§

Source

fn truthy(&self) -> bool

Implementations on Foreign Types§

Source§

impl Truthy for &str

Source§

fn truthy(&self) -> bool

Source§

impl Truthy for bool

Source§

fn truthy(&self) -> bool

Source§

impl Truthy for char

Source§

fn truthy(&self) -> bool

Source§

impl Truthy for f64

Source§

fn truthy(&self) -> bool

Source§

impl Truthy for i64

Source§

fn truthy(&self) -> bool

Source§

impl Truthy for String

Source§

fn truthy(&self) -> bool

Source§

impl<T: Truthy> Truthy for Option<T>

nothing is falsy; a present value keeps its own truthiness (the interpreter never sees the Some wrapper — Some(0) at runtime IS 0).

Source§

fn truthy(&self) -> bool

Implementors§

Source§

impl Truthy for LogosValue

Source§

impl Truthy for LogosComplex

Source§

impl Truthy for LogosDecimal

Source§

impl Truthy for LogosRational

Source§

impl<K: Eq + Hash, V> Truthy for LogosMap<K, V>

Source§

impl<T> Truthy for LogosSeq<T>

Source§

impl<T> Truthy for FxIndexSet<T>

Source§

impl<T: Truthy> Truthy for LogosOpt<T>

nothing is false where a condition reads it, and a value is as true as it is.