bb_runtime/roles/mod.rs
1//! Framework-internal engine-side `<Role>Runtime` traits.
2//!
3//! Each role trait pairs with a user-facing `bb::<Role>` Contract
4//! trait in [`crate::contracts`]; the `#[derive(bb::<Role>)]`
5//! macros bridge the user's Contract impl into the engine-side
6//! `<Role>Runtime` impl the engine dispatches against. Library
7//! authors should not implement these directly — see
8//! [`crate::contracts`].
9//!
10//! Each role trait follows the universal contract:
11//!
12//! ```ignore
13//! pub trait <Role>Runtime: Send + Sync {
14//! type Error: std::error::Error + Send + Sync + 'static;
15//!
16//! fn atomic_opset(&self) -> AtomicOpsetDecl;
17//! fn dispatch_atomic(
18//! &mut self,
19//! op_type: &str,
20//! inputs: &[(&str, &dyn SlotValue)],
21//! ctx: &mut RuntimeResourceRef<'_>,
22//! ) -> Result<DispatchResult, Self::Error>;
23//! }
24//! ```
25
26pub mod aggregator;
27pub mod backend;
28pub mod codec;
29pub mod data_source;
30pub mod index;
31pub mod model;
32pub mod peer_selector;
33pub mod protocol;
34
35pub use aggregator::AggregatorRuntime;
36pub use backend::BackendRuntime;
37pub use codec::CodecRuntime;
38pub use data_source::DataSourceRuntime;
39pub use index::IndexRuntime;
40pub use model::ModelRuntime;
41pub use peer_selector::PeerSelectorRuntime;
42pub use protocol::ProtocolRuntime;