Expand description
indexbus-kit is the final, application-facing ergonomics layer for IndexBus.
It exists to make it easy to assemble correct applications from the substrate crates
(indexbus-abi, indexbus-core, transports, routing, codecs) without hiding what is
actually happening.
§Design constraints
- Keep substrate crates explicit and stable (
indexbus-abi,indexbus-core, transports). - Put ergonomics here: thin wrappers, safe constructors, curated re-exports.
- Prefer feature-gated optional integrations (blocking, runtimes, UDP, etc.).
§Kit contract (stability vs convenience)
indexbus-kit is intentionally a kit, not a substrate layer. That means it provides
convenience APIs for apps while remaining conservative about what it promises to keep
stable.
Stable-by-intent (contract surface):
- Feature flags behave as documented in the crate’s
Cargo.toml(e.g.no_stdrequiresalloc,stdenables host-side helpers). - Error behavior: helpers return
crate::errors::Resultand do not silently swallow substrate errors. embedded,msg, andtypedmodules aim to remain source-compatible and are the preferred surface for “library-like” reuse inside an application.
Convenience (may change as patterns evolve):
crate::preludecontents and re-exports.lanes::*orchestration helpers (thread spawning, region open helpers, defaults).shmtemp-path helpers and small wiring shims.
This crate is intended to be the clear onboarding story for IndexBus: if you’re building an application (not a new transport or ABI/layout), start here.
Module map (discoverability-first):
lanes: named lanes (routing,sequencer,journal) for host-side flows.embedded: static-memory/no-heap building blocks intended to beno_stdfriendly.typed: typed message helpers (codec selection + constructors).msg: envelope/header helpers.runtime/blocking/transport/shm: host integrations (std-only).
§Minimal embedded-style SPSC
use indexbus_kit::embedded::static_spsc;
use indexbus_kit::errors::Result;
// `static_spsc()` is single-use (it returns handles into a single static region).
let (tx, rx) = static_spsc().unwrap();
tx.publish(b"hi").unwrap();
let mut out = [0u8; 64];
let n = rx.try_recv_into(&mut out).unwrap().unwrap();
assert_eq!(&out[..n], b"hi");Modules§
- embedded
- Embedded-oriented helpers (static memory, no-heap algorithms).
- errors
- Error type and
Resultalias used throughoutindexbus-kit. Error type used byindexbus-kit. - lanes
- Named lane modules.
- msg
indexbus-msgenvelope helpers.- prelude
- Curated prelude for application code.
- runtime
- Runtime-facing helpers.
- shm
- SHM helpers: temp paths, region open options, cleanup.
- transport
- Transport helpers and re-exports.
- typed
- Typed-message helpers.