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 regex_util;
19pub mod typed_config;
20pub mod version;
21
22/// Re-exported so downstream `#[distributed_slice]` users can use
23/// `rtb_app::linkme::distributed_slice` without adding `linkme` to
24/// their own `Cargo.toml` directly.
25pub use linkme;
26
27/// Glob-importable prelude for typical application wiring.
28pub mod prelude {
29    pub use crate::app::App;
30    pub use crate::command::{Command, CommandSpec, BUILTIN_COMMANDS};
31    pub use crate::features::{Feature, Features};
32    pub use crate::metadata::{HelpChannel, ReleaseSource, ToolMetadata, UpdatePolicy};
33    pub use crate::regex_util::compile_bounded;
34    pub use crate::version::VersionInfo;
35
36    /// Re-exported from `rtb-credentials` so downstream tools that
37    /// implement the v0.4 `credentials` subtree don't need to add
38    /// the credentials crate to their direct dep list.
39    pub use rtb_credentials::{CredentialBearing, CredentialRef};
40
41    pub use crate::credentials::{CredentialProvider, NoCredentials};
42}