pub trait ComputedVariable: Send + Sync {
// Required methods
fn evaluate(&self, context: &VariableContext) -> Result<Value>;
fn cache_key(&self) -> String;
fn is_expensive(&self) -> bool;
}Expand description
Trait for computed variables that evaluate on demand
Required Methods§
Sourcefn evaluate(&self, context: &VariableContext) -> Result<Value>
fn evaluate(&self, context: &VariableContext) -> Result<Value>
Evaluate the variable in the given context
Sourcefn is_expensive(&self) -> bool
fn is_expensive(&self) -> bool
Whether this computation is expensive
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".