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).