Skip to main content

rtb_app/
lib.rs

1//! Core types for Rust Tool Base: the application context, service traits,
2//! tool metadata, and feature-flag registry.
3//!
4//! The central type is [`app::App`], a strongly-typed application context that
5//! replaces Go Tool Base's dynamic `Props` container. Services are held in
6//! `Arc<T>` and `App` is cheap to clone — command handlers take it by value.
7//!
8//! See `docs/development/specs/2026-04-22-rtb-app-v0.1.md` for the
9//! authoritative contract.
10
11#![forbid(unsafe_code)]
12
13pub mod app;
14pub mod command;
15pub mod credentials;
16pub mod features;
17pub mod metadata;
18pub mod typed_config;
19pub mod version;
20
21/// Re-exported so downstream `#[distributed_slice]` users can use
22/// `rtb_app::linkme::distributed_slice` without adding `linkme` to
23/// their own `Cargo.toml` directly.
24pub use linkme;
25
26/// Glob-importable prelude for typical application wiring.
27pub mod prelude {
28    pub use crate::app::App;
29    pub use crate::command::{Command, CommandSpec, BUILTIN_COMMANDS};
30    pub use crate::features::{Feature, Features};
31    pub use crate::metadata::{HelpChannel, ReleaseSource, ToolMetadata};
32    pub use crate::version::VersionInfo;
33
34    /// Re-exported from `rtb-credentials` so downstream tools that
35    /// implement the v0.4 `credentials` subtree don't need to add
36    /// the credentials crate to their direct dep list.
37    pub use rtb_credentials::{CredentialBearing, CredentialRef};
38
39    pub use crate::credentials::{CredentialProvider, NoCredentials};
40}