rtb-app 0.9.2

Application context, tool metadata, runtime features, and the Command plugin trait. Part of the phpboyscout Rust toolkit.
Documentation
# rtb-app

> Part of the [phpboyscout Rust toolkit]https://rust.phpboyscout.uk:
> small, framework-free crates extracted from
> [rust-tool-base]https://gitlab.com/phpboyscout/rust-tool-base.

A two-crate family workspace sharing one version line:

- **`rtb-app`**: the application context (`App`), tool metadata,
  runtime features, and the `Command` plugin trait with its
  `BUILTIN_COMMANDS` link-time registry. It is the structural heart of
  the framework, with typed `Arc`-wrapped fields, no DI container and no
  `Box<dyn Any>` bag.
- **`rtb-test-support`**: the promoted test-side `App` constructor
  (`TestAppBuilder` behind a sealed `TestWitness`), consumed from
  `[dev-dependencies]` by downstream crates.

```toml
[dependencies]
rtb-app = "0.9"
linkme = "0.3"      # only if you register commands

[dev-dependencies]
rtb-test-support = "0.9"
```

`linkme` has to be a direct dependency of any crate that registers a
command, because `#[distributed_slice]` expands to `::linkme::…` paths.
[Register a command](https://app.rust.phpboyscout.uk/how-to/01-register-a-command/)
shows the alternative.

```rust
use rtb_app::features::{Feature, Features};

let features = Features::builder().disable(Feature::Init).build();
assert!(!features.is_enabled(Feature::Init));
assert!(features.is_enabled(Feature::Version));
```

`Feature` and `Features` live in `rtb_app::features`, not at the crate
root. `use rtb_app::prelude::*;` brings both in alongside the rest of
the usual wiring types.

## Documentation

<https://app.rust.phpboyscout.uk>

- **[Tutorial]https://app.rust.phpboyscout.uk/tutorials/01-your-first-command/**:
  from an empty crate to a registered command with passing tests.
- **[How-to guides]https://app.rust.phpboyscout.uk/how-to/**:
  registering commands, reporting your own version, reading typed
  config, wiring self-update, building an `App` in tests.
- **[Reference]https://app.rust.phpboyscout.uk/reference/**: every
  public type, field and default, and what happens when one is wrong.
- **[Explanation]https://app.rust.phpboyscout.uk/explanation/**: why
  `App` is not a container, why registration is link-time, why the
  config is type-erased, and
  [what this crate does not do]https://app.rust.phpboyscout.uk/explanation/05-limitations/.

Other links:

- **API reference:** <https://docs.rs/rtb-app> ·
  <https://docs.rs/rtb-test-support>
- **Crates:** <https://crates.io/crates/rtb-app> ·
  <https://crates.io/crates/rtb-test-support>

## Development

`just ci` runs the full local gate (fmt, clippy, nextest, doc, deny).
Tests include a cucumber BDD suite (`crates/rtb-app/tests/bdd.rs`) and
trybuild compile-fail fixtures, which nextest runs isolated (see
`.config/nextest.toml`), so install `cargo-nextest` rather than relying
on the recipe's `cargo test` fallback. Releases are cut by colophon
from Conventional Commits; do not tag manually.

## License

MIT