fidius_guest/lib.rs
1// Copyright 2026 Colliery, Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15//! `fidius-guest` — the wasm-buildable subset of the Fidius shared types.
16//!
17//! Extracted from `fidius-core` (FIDIUS-I-0022) so plugin guests — including
18//! Rust WASM components built from `#[plugin_impl]` — can depend on the
19//! interface hashing, descriptors, the neutral [`value::Value`] model, and the
20//! bincode wire format **without** dragging in the host-only packaging stack
21//! (archive/compression/filesystem). This crate has no such dependencies and
22//! compiles cleanly to `wasm32-wasip2`.
23//!
24//! `fidius-core` re-exports every module here, so `fidius_core::descriptor`,
25//! `fidius_core::hash`, `fidius_core::value`, … (and the `fidius` facade
26//! re-exports) resolve unchanged — this split is internal, with no public-API
27//! churn.
28//!
29//! Note: `descriptor::ABI_VERSION` derives from this crate's `CARGO_PKG_VERSION`
30//! (per ADR-0002), so `fidius-guest` is versioned in lockstep with `fidius-core`.
31
32pub mod descriptor;
33pub mod error;
34pub mod frame;
35pub mod hash;
36/// Brokered outbound HTTP for sandboxed WASM connectors (FIDIUS-I-0028).
37/// Only present in components built for `wasm32-wasip2`.
38#[cfg(target_family = "wasm")]
39pub mod http;
40
41/// Client-streaming guest consumer (`WasmHostStream`) over the `fidius:stream-pull`
42/// import (FIDIUS-I-0030 CS2.3). `wasm32-wasip2`-only.
43#[cfg(target_family = "wasm")]
44pub mod client_stream;
45pub mod python_descriptor;
46pub mod status;
47pub mod stream_ffi;
48pub mod stream_marker;
49pub mod value;
50pub mod wasm_descriptor;
51pub mod wire;
52
53pub use descriptor::*;
54pub use error::PluginError;
55pub use frame::{Frame, FrameError};
56pub use status::*;
57pub use stream_ffi::FidiusStreamHandle;
58pub use stream_marker::Stream;
59pub use value::{from_value, to_value, Value, ValueError};