ruststream 0.7.0-rc.8

Async messaging framework for Rust: broker-agnostic traits, router, codecs, and a conformance harness for broker authors.
Documentation
{
  "url": "https://context7.com/powersemmi/ruststream",
  "public_key": "pk_uUlur6QCUlrZ8v1BsB2Wn",
  "rules": [
    "Import `ruststream::prelude::*` in a service, or the broker crate's own prelude, which re-exports it; the broker and the codec stay explicit choices.",
    "Declare a handler as an `async fn` under `#[subscriber(..)]` whose first parameter is `&T` for one message or `&[T]` for a batch; mount it with `b.include(handler)` inside `with_broker`, and a batch handler with `.batch(n)`.",
    "A reply type derives `Outgoing`: `#[outgoing(name = \"..\")]` fixes its destination and the subscriber writes the bare `publish`; a type without a name takes `publish(\"dest\")` at the mount site, never both.",
    "Publish from inside a handler through an `Out(out): Out<impl Publisher>` parameter bound at the mount site with `.out(marker, policy).build()`; a handler signature never names a broker's publisher type.",
    "The codec is chosen at the mount site (`with_broker_codec`, `Router::with_codec`, `.out_reply(policy).codec(..)`), never per message type; a type that is its own encoding derives `Serialized` or `Deserialized` and needs no codec.",
    "Cap redeliveries at the mount site with `.max_attempts(n)` and `.dead_letter(name)` right after `include`; `.out_retry(policy)` only replaces the publisher the retry copy leaves through.",
    "Test a service with `ruststream::testing::TestApp` (feature `testing`) against the broker's in-process transport; do not mock the broker traits.",
    "Generate `main` with `#[ruststream::app]` and run the service with `cargo run -- run`; use `start()` only when the service runs beside another server such as an HTTP framework.",
    "Broker-specific settings live on the broker crate's subscription descriptor and publish policy, in that crate's vocabulary; the core exposes none.",
    "A transform that names a destination per delivery reads the address with `HeaderMap::get_shared` and passes the `Str` to `Outgoing::set_name`, so the name shares the delivery's buffer instead of being copied out of it.",
    "Misuse is rejected at compile time by design: read the compiler error, it names the missing derive, the unbound slot or the wrong position; do not work around it with runtime checks.",
    "Check what a change costs per message with `just bench`: it measures the framework against a hand-written loop over the same queue, and CI fails a pull request that adds more than two percent of instructions or a new allocation on a gated path.",
    "Open a pull request as a draft and leave it a draft until the maintainer marks it ready for review: CI runs nothing on a draft, so its time is spent once, on the work the maintainer wants checked."
  ]
}