ruststream 0.5.0

Async messaging framework for Rust: broker-agnostic traits, router, codecs, and a conformance harness for broker authors.
Documentation
# The CLI

The `ruststream` command-line tool drives `cargo` with the framework's subcommands. Scaffolding a
new project is `cargo generate` (see [Scaffolding](#scaffolding) below), so the tool no longer ships
its own `new` command.

```bash
cargo install ruststream --features cli
```

A RustStream service is an ordinary Rust binary whose `main` is generated by `#[ruststream::app]`.
The CLI does not introspect it; `run` and `asyncapi gen` shell out to `cargo run` against the target
crate.

## Commands

```bash
ruststream run                         # cargo run -- run, against ./Cargo.toml
ruststream run -p ./my-service         # against another crate
ruststream run --release               # release build
ruststream asyncapi gen                # print the AsyncAPI document
ruststream asyncapi gen -o spec.json   # write it to a file
ruststream asyncapi gen --yaml         # YAML instead of JSON
```

`run` and `asyncapi gen` take `-p/--manifest-path` (defaulting to the current directory) to point at
a crate other than the working directory.

## The generated entry point

`#[ruststream::app]` turns a builder function into a `main` that understands `run` and
`asyncapi gen`, so there is no runtime boilerplate:

```rust
use ruststream::memory::MemoryBroker;
use ruststream::runtime::{AppInfo, RustStream};

--8<-- "examples/quickstart.rs:app"
```

Because the dispatch lives in the generated binary, both `ruststream run` and a plain
`cargo run -- run` start the service the same way. `ruststream run` is a convenience that finds the
crate and forwards the command to `cargo`.

## Scaffolding

New projects are generated with [`cargo generate`](https://github.com/cargo-generate/cargo-generate)
from a template. Templates are owned by the crate whose broker they wire: the in-memory starter lives
in this repo, and each broker crate ships its own.

```bash
cargo install cargo-generate

# in-memory starter (no external broker)
cargo generate --git https://github.com/powersemmi/ruststream templates/memory --name my-service

# a broker template (owned by the broker repo)
cargo generate --git https://github.com/powersemmi/ruststream-nats templates/nats --name my-service
```

Each template writes a multi-file project so a fresh service starts idiomatic rather than as a single
dumping-ground file:

```
my-service/
├── Cargo.toml
└── src/
    ├── main.rs      # #[ruststream::app], mounts the router
    ├── orders.rs    # #[subscriber] handlers, one with a reply
    └── routes.rs    # a Router collecting the handlers
```

A broker repo typically ships one template per transport or topology (for example `nats` vs
`nats-js`). See the [quick start](../getting-started/quickstart.md) to scaffold and run one;
authoring a template for a new broker follows the [template contract](templates.md).