Skip to main content

Crate herkos_runtime

Crate herkos_runtime 

Source
Expand description

herkos-runtime — Runtime library for herkos transpiled output.

This crate is #![no_std] by default. It provides:

  • IsolatedMemory<const MAX_PAGES: usize> for Wasm linear memory
  • WasmTrap / WasmResult<T> for Wasm trap handling
  • Trait definitions for capability-based host imports (Phase 3+)

Structs§

FuncRef
A single table entry: a typed function reference.
IsolatedMemory
Isolated linear memory for a single Wasm module.
LibraryModule
A module that does NOT define its own memory (§4.1).
Module
A module that defines its own memory (§4.1).
Table
Indirect call table with a compile-time maximum size.

Enums§

ConstructionError
Errors that occur during module/memory/table construction.
WasmTrap
Wasm execution errors — no panics, no unwinding.

Constants§

PAGE_SIZE
WebAssembly page size: 64 KiB per the Wasm specification.

Functions§

i32_div_s
Wasm i32.div_s: signed integer division, trapping on divide-by-zero or signed overflow (i32::MIN / -1). Both cases produce None from checked_div, which maps to DivisionByZero.
i32_div_u
Wasm i32.div_u: unsigned integer division, trapping on divide-by-zero.
i32_rem_s
Wasm i32.rem_s: signed remainder, trapping on divide-by-zero.
i32_rem_u
Wasm i32.rem_u: unsigned remainder, trapping on divide-by-zero.
i32_trunc_f32_s
Wasm i32.trunc_f32_s: truncate f32 toward zero to i32, trapping on NaN/overflow.
i32_trunc_f32_u
Wasm i32.trunc_f32_u: truncate f32 toward zero to u32 (returned as i32), trapping on NaN or out-of-range input.
i32_trunc_f64_s
Wasm i32.trunc_f64_s: truncate f64 toward zero to i32, trapping on NaN/overflow.
i32_trunc_f64_u
Wasm i32.trunc_f64_u: truncate f64 toward zero to u32 (returned as i32), trapping on NaN or out-of-range input.
i64_div_s
Wasm i64.div_s: signed integer division, trapping on divide-by-zero or signed overflow (i64::MIN / -1).
i64_div_u
Wasm i64.div_u: unsigned integer division, trapping on divide-by-zero.
i64_rem_s
Wasm i64.rem_s: signed remainder, trapping on divide-by-zero.
i64_rem_u
Wasm i64.rem_u: unsigned remainder, trapping on divide-by-zero.
i64_trunc_f32_s
Wasm i64.trunc_f32_s: truncate f32 toward zero to i64, trapping on NaN/overflow.
i64_trunc_f32_u
Wasm i64.trunc_f32_u: truncate f32 toward zero to u64 (returned as i64), trapping on NaN or out-of-range input.
i64_trunc_f64_s
Wasm i64.trunc_f64_s: truncate f64 toward zero to i64, trapping on NaN/overflow.
i64_trunc_f64_u
Wasm i64.trunc_f64_u: truncate f64 toward zero to u64 (returned as i64), trapping on NaN or out-of-range input.

Type Aliases§

WasmResult
Result type for Wasm operations — Result<T, WasmTrap>.