bb_runtime/lib.rs
1#![warn(missing_docs)]
2//! `bb-runtime` — sans-IO engine. Hosts Node + Engine + framework
3//! primitives + role-runtime traits + syscall registration +
4//! snapshot. Consumes compiled `ModelProto`s from `bb-compiler`.
5//! Concrete components live in `bb-ops`.
6
7#![allow(rustdoc::broken_intra_doc_links)]
8
9// bb-derive emits `::bytesandbrains::*` paths; resolve them locally.
10extern crate self as bytesandbrains;
11
12/// `ConcreteComponent` polymorphism contract + the
13/// `ComponentHandle` fn-pointer-capture wrapper.
14pub mod concrete;
15
16/// `ExecState` — per-poll execution-state bundle (frontier,
17/// slot table, pending state, scheduler, inbound contexts,
18/// monotonic ID allocator). Owned by `Engine` as one field.
19pub mod exec_state;
20
21/// Engine identifier types — `PeerId`, `NodeSiteId`, `OpRef`,
22/// `ComponentRef`, `ExecId`, `CommandId`, `RequestId`, `OpsetId`,
23/// `ComponentTag`.
24pub mod ids;
25
26/// `AtomicOpsetDecl`, `AtomicOpDecl`, `AtomicOpKind`, `DispatchResult`.
27pub mod atomic;
28
29/// The universal `SlotValue` trait.
30pub mod slot_value;
31
32/// `CompletionHandle`, `CompletionSink`, `ContractResponse`.
33pub mod completion;
34
35/// `AnyComponent`, `ErasedComponent`, `ComponentPackage`, `RestoreError`.
36pub mod component;
37
38/// User-facing Contract traits (`Index`, `Backend`, `Aggregator`, …).
39pub mod contracts;
40
41/// Typed in-Node event bus.
42pub mod bus;
43
44/// The sans-IO Engine state machine.
45pub mod engine;
46
47/// `WireEnvelope` codec; per-type decoders register through
48/// `bb_ir::slot_value::register_type_node!`.
49pub mod envelope;
50
51/// Public error taxonomies.
52pub mod errors;
53
54/// `try_reserve_exact` wrapper at ingress boundaries so allocator
55/// failures surface as typed events. `fallible::testing` is a
56/// stub-allocator seam under `test-components`.
57#[cfg(any(test, feature = "test-components"))]
58pub mod fallible;
59
60#[cfg(not(any(test, feature = "test-components")))]
61pub(crate) mod fallible;
62
63/// Framework primitives bundled into every `RuntimeResourceRef`.
64pub mod framework;
65
66/// Lock-free MPMC ingress queue.
67pub mod ingress;
68
69/// Public `Node` + lazy build chain.
70pub mod node;
71
72/// Global inventory-collected registry for custom ops.
73pub mod registry;
74
75/// The `<Role>Runtime` role traits.
76pub mod roles;
77
78/// Runtime resource handle + `ComponentTimerKind`.
79pub mod runtime;
80
81/// `NodeSnapshot`.
82pub mod snapshot;
83
84/// Foundation `SlotValue` impls - `PeerIdValue`, `WireReqIdValue`,
85/// `TriggerValue`, `BytesValue`, `CommandIdValue`.
86pub mod syscall;
87
88/// Optional OpenTelemetry layer constructors for the engine's
89/// `tracing::` spans.
90pub mod telemetry;