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§
Implementations on Foreign Types§
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).
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).
Implementors§
impl Truthy for LogosValue
impl Truthy for LogosComplex
impl Truthy for LogosDecimal
impl Truthy for LogosRational
impl<K: Eq + Hash, V> Truthy for LogosMap<K, V>
impl<T> Truthy for LogosSeq<T>
impl<T> Truthy for FxIndexSet<T>
impl<T: Truthy> Truthy for LogosOpt<T>
nothing is false where a condition reads it, and a value is as true as it is.