Skip to main content

Host

Trait Host 

Source
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§

Source

fn scan_start(&mut self, rel_id: i32) -> i32

Source

fn scan_delta_start(&mut self, rel_id: i32) -> i32

Source

fn scan_next(&mut self, iter_id: i32) -> i32

Source

fn merge_deltas(&mut self) -> i32

Merges deltas and returns 1 if changes occurred, 0 otherwise.

Source

fn scan_aggregate_start(&mut self, rel_id: i32, description: Vec<i32>) -> i32

Source

fn scan_index_start(&mut self, rel_id: i32, col_idx: i32, val: HostVal) -> i32

Source

fn get_col(&mut self, tuple_ptr: i32, col_idx: i32) -> HostVal

Source

fn insert_begin(&mut self, rel_id: i32)

Source

fn insert_push(&mut self, val: HostVal)

Source

fn insert_end(&mut self)

Source

fn const_number(&mut self, n: i64) -> HostVal

Source

fn const_float(&mut self, bits: i64) -> HostVal

Source

fn const_string(&mut self, id: i32) -> HostVal

Source

fn const_name(&mut self, id: i32) -> HostVal

Source

fn const_time(&mut self, nanos: i64) -> HostVal

Source

fn const_duration(&mut self, nanos: i64) -> HostVal

Source

fn val_add(&mut self, a: HostVal, b: HostVal) -> HostVal

Source

fn val_sub(&mut self, a: HostVal, b: HostVal) -> HostVal

Source

fn val_mul(&mut self, a: HostVal, b: HostVal) -> HostVal

Source

fn val_div(&mut self, a: HostVal, b: HostVal) -> HostVal

Source

fn val_sqrt(&mut self, a: HostVal) -> HostVal

Source

fn val_eq(&mut self, a: HostVal, b: HostVal) -> i32

Source

fn val_neq(&mut self, a: HostVal, b: HostVal) -> i32

Source

fn val_lt(&mut self, a: HostVal, b: HostVal) -> i32

Source

fn val_le(&mut self, a: HostVal, b: HostVal) -> i32

Source

fn val_gt(&mut self, a: HostVal, b: HostVal) -> i32

Source

fn val_ge(&mut self, a: HostVal, b: HostVal) -> i32

Source

fn str_concat(&mut self, a: HostVal, b: HostVal) -> HostVal

Source

fn str_replace( &mut self, s: HostVal, old: HostVal, new: HostVal, count: HostVal, ) -> HostVal

Source

fn val_to_string(&mut self, val: HostVal) -> HostVal

Source

fn compound_begin(&mut self, kind: i32)

Begin building a compound value. kind: 0=List, 1=Pair, 2=Map, 3=Struct.

Source

fn compound_push(&mut self, val: HostVal)

Source

fn compound_end(&mut self) -> HostVal

Source

fn compound_get(&mut self, compound: HostVal, key: HostVal) -> HostVal

Get element by index (list) or value by key (map/struct).

Source

fn compound_len(&mut self, compound: HostVal) -> HostVal

Get length/size of compound, returned as a Number HostVal.

Source

fn pair_first(&mut self, compound: HostVal) -> HostVal

Source

fn pair_second(&mut self, compound: HostVal) -> HostVal

Source

fn debuglog(&mut self, val: HostVal)

Implementors§