pub enum HostFunction {
Log {
level: LogLevel,
message: String,
},
ReadColumn {
name: String,
},
EmitRow {
row: Value,
},
GetEnv {
key: String,
},
HttpRequest {
url: String,
method: HttpMethod,
body: Option<String>,
},
}Expand description
The full host-function set.
Variants map 1:1 to WASM imports that JS scripts can call. The enum is a
convenience for dispatch; individual hooks live on the HostContext trait
so callers only implement the pieces they need.
Variants§
Log
console.log / console.error bridge.
ReadColumn
Read a named column from the current row batch. Wired by hosts that run the engine in a tabular context; a no-op otherwise.
EmitRow
Emit a transformed row. Wired by hosts that run the engine in a tabular context.
GetEnv
Read an allow-listed environment variable.
HttpRequest
HTTP out-call. Gated behind the host-http cargo feature in
afterburner-wasi.
Trait Implementations§
Source§impl Clone for HostFunction
impl Clone for HostFunction
Source§fn clone(&self) -> HostFunction
fn clone(&self) -> HostFunction
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for HostFunction
impl RefUnwindSafe for HostFunction
impl Send for HostFunction
impl Sync for HostFunction
impl Unpin for HostFunction
impl UnsafeUnpin for HostFunction
impl UnwindSafe for HostFunction
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more