Skip to main content

Crate rill_runtime

Crate rill_runtime 

Source
Expand description

Independently distributable runtime for RillML.

Implementation modules (archive, handler, handler_package, package, server) are pub(crate) so that downstream code — including the rill-runtime and rill-pack binaries, integration tests, and external crates — depends only on the top-level re-exports declared in this file. This avoids the dual-module-path problem where both rill_runtime::handler::wasm::WasmInvokeHandler and rill_runtime::WasmInvokeHandler would otherwise be part of the 1.x public API surface. Only the re-export path is stable.

Structs§

HandlerIdentity
Identity reported by the runtime in IPC v2 handshake responses.
HandlerPackInspection
InvokeError
Typed invoke error.
LinearRegressionInvokeHandler
Business-neutral linear-regression handler used by the distributed runtime binary.
LoadedHandlerPack
LoadedModelPack
ModelPackInspection
RuntimeEngine
StatefulHandlerErrorV2
Typed handler error with bounded host-only detail.
StatefulHandlerMetadataV2
Metadata declared by a Preview ABI v2 handler.
StatefulHandlerResultV2
Successful handler result. next_state is a proposal; the Runtime still validates it before making it current.
StatefulRuntimeConfigV3
Construction contract for the V3 runtime.
StatefulRuntimeEngineV3
Preview Runtime V3 engine for Stateful Handler ABI v2.
StatefulStateSnapshotV2
Serializable Runtime-owned state snapshot. Restores verify all fields, state size, JSON validity and checksum before activation.
StderrLogSink
Default HostLogSink writing to stderr via eprintln!.
TrustStore
WasmInvokeHandler
Sandboxed WASM handler that implements crate::server::InvokeHandler.
WasmStatefulHandlerV2
Sandboxed ABI v2 handler. The linker provides no WASI interfaces, so the guest has no filesystem, network, environment, process, stdio, clock or random imports.

Enums§

ArchiveError
EngineResponse
Engine-side response produced by RuntimeEngine. The IPC layer converts this to a v1 RuntimeResponse or v2 RuntimeResponseV2 based on the request’s api_version.
HandlerLoadError
Errors that arise while loading or preparing a handler for execution.
HandlerPackError
InvokeErrorKind
Stable categorisation of invoke failures.
ModelPackError
ReleaseIndexError
StatefulHandlerErrorKindV2
Stateful handler failure categories. All failures are fail-closed and leave the Runtime-owned state unchanged.

Constants§

CONFIGURE_FUEL
Fuel budget for a single configure call.
EPOCH_DEADLINE
Number of epoch ticks before interruption (5 seconds).
EPOCH_TICK_INTERVAL
Epoch tick interval (1 second).
INVOKE_FUEL
Fuel budget for a single invoke call.
LINEAR_REGRESSION_CAPABILITY
MAX_DETAIL_BYTES
Maximum byte length of the host-only detail string. Guests can fully control this payload via the WIT handler-error variant, so the host truncates it to bound memory and stderr noise. The limit is enforced on a UTF-8 char boundary so the stored string stays valid.
MAX_IO_BYTES
Maximum input/output JSON payload size (1 MiB, matches IPC limit).
MAX_MEMORY_BYTES
Maximum linear memory size per instance (64 MiB).
MAX_TABLE_ELEMENTS
Maximum table entries per instance.
STATEFUL_CONFIGURE_FUEL
STATEFUL_EPOCH_DEADLINE
STATEFUL_EPOCH_TICK_INTERVAL
STATEFUL_HANDLE_FUEL

Traits§

HostLogSink
Minimal host-side log sink for invoke diagnostics.
InvokeHandler
Consumers can implement this trait to add business-specific invocation logic.
StatefulHandlerV2
Host abstraction implemented by sandboxed ABI v2 handlers and test doubles. It grants no filesystem, network, process, time or randomness; deterministic randomness is supplied only through deterministic_seed.

Functions§

build_signed_handler_pack
build_signed_model_pack
canonical_json
effective_capabilities
Computes the effective capability set: the intersection of model and handler capabilities. Returns an error if the handler does not cover every model capability (first version rejects silent capability loss).
load_handler_pack
load_model_pack
sign_release_index
verify_release_index