Skip to main content

TruthPolicy

Trait TruthPolicy 

Source
pub trait TruthPolicy: Send + Sync {
    // Required method
    fn is_truthy(&self, cx: &mut Cx, value: &Value) -> Result<bool>;
}
Expand description

How a guest language decides whether a runtime value is truthy.

Required Methods§

Source

fn is_truthy(&self, cx: &mut Cx, value: &Value) -> Result<bool>

Return whether value counts as truthy for this guest profile.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§