pub trait Ctx {
// Required methods
fn date_system(&self) -> DateSystem;
fn now_serial(&self) -> f64;
fn random(&mut self) -> f64;
// Provided methods
fn computed_criterion(
&mut self,
_row: usize,
_col: usize,
_db: &Array,
_record: usize,
) -> Option<bool> { ... }
fn has_lambda(&self) -> bool { ... }
fn call_lambda(&mut self, _arg: Value) -> Option<Value> { ... }
}Expand description
Services a function may need from the host.
Required Methods§
fn date_system(&self) -> DateSystem
Sourcefn now_serial(&self) -> f64
fn now_serial(&self) -> f64
Current local date-time serial.
Provided Methods§
Sourcefn computed_criterion(
&mut self,
_row: usize,
_col: usize,
_db: &Array,
_record: usize,
) -> Option<bool>
fn computed_criterion( &mut self, _row: usize, _col: usize, _db: &Array, _record: usize, ) -> Option<bool>
For the database functions: whether the formula in the criteria cell at (row, col) holds
for record (a row of db below its labels). None when that cell holds no formula or the
criteria didn’t come from a reference.
Sourcefn has_lambda(&self) -> bool
fn has_lambda(&self) -> bool
For GROUPBY/PIVOTBY: whether their function argument is a LAMBDA (its value is then not used).
Sourcefn call_lambda(&mut self, _arg: Value) -> Option<Value>
fn call_lambda(&mut self, _arg: Value) -> Option<Value>
Calls that LAMBDA with arg (one group’s values) and returns its single result; None when
there is no lambda.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".