Skip to main content

rill_runtime/
lib.rs

1//! Independently distributable runtime for RillML.
2//!
3//! Implementation modules (`archive`, `handler`, `handler_package`, `package`,
4//! `server`) are `pub(crate)` so that downstream code — including the
5//! `rill-runtime` and `rill-pack` binaries, integration tests, and external
6//! crates — depends only on the top-level re-exports declared in this file.
7//! This avoids the dual-module-path problem where both
8//! `rill_runtime::handler::wasm::WasmInvokeHandler` and
9//! `rill_runtime::WasmInvokeHandler` would otherwise be part of the 1.x
10//! public API surface. Only the re-export path is stable.
11
12pub(crate) mod archive;
13pub(crate) mod handler;
14pub(crate) mod handler_package;
15pub(crate) mod package;
16pub(crate) mod server;
17pub(crate) mod stateful;
18#[cfg(feature = "wasm")]
19pub(crate) mod stateful_wasm;
20
21pub use archive::{
22    ArchiveError, ReleaseIndexError, TrustStore, canonical_json, sign_release_index,
23    verify_release_index,
24};
25pub use handler::builtin::{LINEAR_REGRESSION_CAPABILITY, LinearRegressionInvokeHandler};
26#[cfg(feature = "wasm")]
27pub use handler::wasm::WasmInvokeHandler;
28#[cfg(feature = "wasm")]
29pub use handler::wasm::{
30    CONFIGURE_FUEL, EPOCH_DEADLINE, EPOCH_TICK_INTERVAL, INVOKE_FUEL, MAX_IO_BYTES,
31    MAX_MEMORY_BYTES, MAX_TABLE_ELEMENTS,
32};
33pub use handler::{HandlerIdentity, HandlerLoadError, effective_capabilities};
34pub use handler_package::{
35    HandlerPackError, HandlerPackInspection, LoadedHandlerPack, build_signed_handler_pack,
36    load_handler_pack,
37};
38pub use package::{
39    LoadedModelPack, ModelPackError, ModelPackInspection, build_signed_model_pack, load_model_pack,
40};
41pub use server::{
42    EngineResponse, HostLogSink, InvokeError, InvokeErrorKind, InvokeHandler, MAX_DETAIL_BYTES,
43    RuntimeEngine, StderrLogSink,
44};
45pub use stateful::{
46    StatefulHandlerErrorKindV2, StatefulHandlerErrorV2, StatefulHandlerMetadataV2,
47    StatefulHandlerResultV2, StatefulHandlerV2, StatefulRuntimeConfigV3, StatefulRuntimeEngineV3,
48    StatefulStateSnapshotV2,
49};
50#[cfg(feature = "wasm")]
51pub use stateful_wasm::{
52    STATEFUL_CONFIGURE_FUEL, STATEFUL_EPOCH_DEADLINE, STATEFUL_EPOCH_TICK_INTERVAL,
53    STATEFUL_HANDLE_FUEL, WasmStatefulHandlerV2,
54};