pub trait Host {
Show 38 methods
// Required methods
fn scan_start(&mut self, rel_id: i32) -> i32;
fn scan_delta_start(&mut self, rel_id: i32) -> i32;
fn scan_next(&mut self, iter_id: i32) -> i32;
fn merge_deltas(&mut self) -> i32;
fn scan_aggregate_start(
&mut self,
rel_id: i32,
description: Vec<i32>,
) -> i32;
fn scan_index_start(
&mut self,
rel_id: i32,
col_idx: i32,
val: HostVal,
) -> i32;
fn get_col(&mut self, tuple_ptr: i32, col_idx: i32) -> HostVal;
fn insert_begin(&mut self, rel_id: i32);
fn insert_push(&mut self, val: HostVal);
fn insert_end(&mut self);
fn const_number(&mut self, n: i64) -> HostVal;
fn const_float(&mut self, bits: i64) -> HostVal;
fn const_string(&mut self, id: i32) -> HostVal;
fn const_name(&mut self, id: i32) -> HostVal;
fn const_time(&mut self, nanos: i64) -> HostVal;
fn const_duration(&mut self, nanos: i64) -> HostVal;
fn val_add(&mut self, a: HostVal, b: HostVal) -> HostVal;
fn val_sub(&mut self, a: HostVal, b: HostVal) -> HostVal;
fn val_mul(&mut self, a: HostVal, b: HostVal) -> HostVal;
fn val_div(&mut self, a: HostVal, b: HostVal) -> HostVal;
fn val_sqrt(&mut self, a: HostVal) -> HostVal;
fn val_eq(&mut self, a: HostVal, b: HostVal) -> i32;
fn val_neq(&mut self, a: HostVal, b: HostVal) -> i32;
fn val_lt(&mut self, a: HostVal, b: HostVal) -> i32;
fn val_le(&mut self, a: HostVal, b: HostVal) -> i32;
fn val_gt(&mut self, a: HostVal, b: HostVal) -> i32;
fn val_ge(&mut self, a: HostVal, b: HostVal) -> i32;
fn str_concat(&mut self, a: HostVal, b: HostVal) -> HostVal;
fn str_replace(
&mut self,
s: HostVal,
old: HostVal,
new: HostVal,
count: HostVal,
) -> HostVal;
fn val_to_string(&mut self, val: HostVal) -> HostVal;
fn compound_begin(&mut self, kind: i32);
fn compound_push(&mut self, val: HostVal);
fn compound_end(&mut self) -> HostVal;
fn compound_get(&mut self, compound: HostVal, key: HostVal) -> HostVal;
fn compound_len(&mut self, compound: HostVal) -> HostVal;
fn pair_first(&mut self, compound: HostVal) -> HostVal;
fn pair_second(&mut self, compound: HostVal) -> HostVal;
fn debuglog(&mut self, val: HostVal);
}Expand description
Trait for the host environment that provides storage and data access (Server Mode).
All Mangle values (numbers, floats, strings, compounds) are represented as
opaque HostVal handles. In WASM, these map to externref — the WASM module
never inspects values directly; all operations go through host calls.
Required Methods§
fn scan_start(&mut self, rel_id: i32) -> i32
fn scan_delta_start(&mut self, rel_id: i32) -> i32
fn scan_next(&mut self, iter_id: i32) -> i32
Sourcefn merge_deltas(&mut self) -> i32
fn merge_deltas(&mut self) -> i32
Merges deltas and returns 1 if changes occurred, 0 otherwise.
fn scan_aggregate_start(&mut self, rel_id: i32, description: Vec<i32>) -> i32
fn scan_index_start(&mut self, rel_id: i32, col_idx: i32, val: HostVal) -> i32
fn get_col(&mut self, tuple_ptr: i32, col_idx: i32) -> HostVal
fn insert_begin(&mut self, rel_id: i32)
fn insert_push(&mut self, val: HostVal)
fn insert_end(&mut self)
fn const_number(&mut self, n: i64) -> HostVal
fn const_float(&mut self, bits: i64) -> HostVal
fn const_string(&mut self, id: i32) -> HostVal
fn const_name(&mut self, id: i32) -> HostVal
fn const_time(&mut self, nanos: i64) -> HostVal
fn const_duration(&mut self, nanos: i64) -> HostVal
fn val_add(&mut self, a: HostVal, b: HostVal) -> HostVal
fn val_sub(&mut self, a: HostVal, b: HostVal) -> HostVal
fn val_mul(&mut self, a: HostVal, b: HostVal) -> HostVal
fn val_div(&mut self, a: HostVal, b: HostVal) -> HostVal
fn val_sqrt(&mut self, a: HostVal) -> HostVal
fn val_eq(&mut self, a: HostVal, b: HostVal) -> i32
fn val_neq(&mut self, a: HostVal, b: HostVal) -> i32
fn val_lt(&mut self, a: HostVal, b: HostVal) -> i32
fn val_le(&mut self, a: HostVal, b: HostVal) -> i32
fn val_gt(&mut self, a: HostVal, b: HostVal) -> i32
fn val_ge(&mut self, a: HostVal, b: HostVal) -> i32
fn str_concat(&mut self, a: HostVal, b: HostVal) -> HostVal
fn str_replace( &mut self, s: HostVal, old: HostVal, new: HostVal, count: HostVal, ) -> HostVal
fn val_to_string(&mut self, val: HostVal) -> HostVal
Sourcefn compound_begin(&mut self, kind: i32)
fn compound_begin(&mut self, kind: i32)
Begin building a compound value. kind: 0=List, 1=Pair, 2=Map, 3=Struct.
fn compound_push(&mut self, val: HostVal)
fn compound_end(&mut self) -> HostVal
Sourcefn compound_get(&mut self, compound: HostVal, key: HostVal) -> HostVal
fn compound_get(&mut self, compound: HostVal, key: HostVal) -> HostVal
Get element by index (list) or value by key (map/struct).
Sourcefn compound_len(&mut self, compound: HostVal) -> HostVal
fn compound_len(&mut self, compound: HostVal) -> HostVal
Get length/size of compound, returned as a Number HostVal.