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    sign_release_index_with_generation, trust_metadata_digest, verify_release_index,
24    verify_release_index_with_trust_metadata,
25};
26pub use handler::builtin::{LINEAR_REGRESSION_CAPABILITY, LinearRegressionInvokeHandler};
27#[cfg(feature = "wasm")]
28pub use handler::wasm::WasmInvokeHandler;
29#[cfg(feature = "wasm")]
30pub use handler::wasm::{
31    CONFIGURE_FUEL, EPOCH_DEADLINE, EPOCH_TICK_INTERVAL, INVOKE_FUEL, MAX_IO_BYTES,
32    MAX_MEMORY_BYTES, MAX_TABLE_ELEMENTS,
33};
34pub use handler::{HandlerIdentity, HandlerLoadError, effective_capabilities};
35pub use handler_package::{
36    HandlerPackError, HandlerPackInspection, LoadedHandlerPack, build_signed_handler_pack,
37    load_handler_pack,
38};
39pub use package::{
40    LoadedModelPack, ModelPackError, ModelPackInspection, build_signed_model_pack, load_model_pack,
41};
42pub use server::{
43    EngineResponse, HostLogSink, InvokeError, InvokeErrorKind, InvokeHandler, MAX_DETAIL_BYTES,
44    RuntimeEngine, StderrLogSink,
45};
46pub use stateful::{
47    DecisionLedgerEntryV3, RuntimeDiagnosticsV1, RuntimeHealthStatusV1, RuntimeResourceUsageV1,
48    StatefulHandlerErrorKindV2, StatefulHandlerErrorV2, StatefulHandlerMetadataV2,
49    StatefulHandlerResultV2, StatefulHandlerV2, StatefulRuntimeConfigV3, StatefulRuntimeEngineV3,
50    StatefulRuntimeSnapshotV3, StatefulStateMigratorV1, StatefulStateSnapshotV2,
51};
52#[cfg(feature = "wasm")]
53pub use stateful_wasm::{
54    STATEFUL_CONFIGURE_FUEL, STATEFUL_EPOCH_DEADLINE, STATEFUL_EPOCH_TICK_INTERVAL,
55    STATEFUL_HANDLE_FUEL, WasmStatefulHandlerV2,
56};