runtime_rs/lib.rs
1//! # runtime-rs
2//!
3//! Agnostic service composition primitives for multi-service Rust applications.
4//!
5//! No application state, no configuration, no HTTP, no TLS, no DB dependency.
6//! Pull this crate into any Rust project with multiple services; bring your
7//! own state type, implement [`state::SharedState`] and optionally
8//! [`registry::ReloadState`] on it, then use [`registry::Registry`] with the
9//! [`registry::Provider`] / [`registry::Reloadable`] /
10//! [`registry::Runnable`] traits.
11//!
12//! The error model (`registry::Error`, `registry::BoxError`, `registry::Result`)
13//! lives *inside* the [`registry`] module because it is a registry concern —
14//! helper primitives such as [`gate`] have their own semantics and do not
15//! share this error type.
16#[cfg(feature = "events")]
17pub mod events;
18#[cfg(feature = "support")]
19pub mod gate;
20#[cfg(feature = "support")]
21pub mod guard;
22pub mod registry;
23mod runtime;
24pub mod state;
25
26#[cfg(feature = "events")]
27pub use events::{LifecycleBus, LifecycleEvent, ShutdownInitiated};
28#[cfg(feature = "support")]
29pub use gate::{Gate, Permit};
30#[cfg(feature = "support")]
31pub use guard::{Guard, GuardGroup};
32pub use registry::{
33 BoxError, Error, Provider, Registry, ReloadState, Reloadable, Result, Runnable
34};
35pub use runtime::Runtime;
36pub use state::SharedState;