Expand description
Rust core of the RustStream messaging
framework: broker-agnostic traits, message types, codecs, router runtime, and a
conformance harness for broker authors.
§Cargo features
The core traits, the runtime::RustStream application object, middleware, and dispatch are
always present. The rest is additive and opt-in. Codec features are mutually compatible and
enable only the deserializers you need.
json(default):codec::JsonCodec.msgpack: [codec::MsgpackCodec].cbor: [codec::CborCodec].memory: [memory::MemoryBroker], an in-process broker usable in applications, prototypes and tests.macros: the#[subscriber],#[ruststream::app], and#[derive(Message)]macros.asyncapi:AsyncAPIdocument generation and the HTML viewer.metrics: Prometheus metrics middleware and exporter.logging: colored,RUST_LOG-driven console logging viatracing-subscriber([logging::init]). The generatedcliruncommand installs it automatically.conformance: the [conformance::harness] contract suite, per-capability suites in [conformance::capabilities], and broker-agnostic [conformance::helpers] for application tests. Generic over any broker’sTestClient, so it pulls in no concrete broker (enablememorytoo to run it against [memory::MemoryBroker]).cli: theruststreambinary (run,asyncapi gen,new).
Disable defaults (default-features = false) to drop the bundled JSON codec; the core traits,
runtime, and dispatch remain. Add back only what you need.
Re-exports§
pub use runtime::RustStream;
Modules§
- codec
- Pluggable serialization codecs.
- runtime
- Application object, middleware and dispatch.
- testing
- The
TestClienttrait: contract for a broker’s in-process test transport.
Structs§
- Buffered
- A
SubscriptionSourceadapter that buffers the wrapped source’s subscriber into aBatchSubscriber. - Buffered
Subscriber - The subscriber
Bufferedopens: the wrapped source’s subscriber plus client-side batching. - Extensions
- A per-delivery type-map: at most one value per type, scoped to a single delivery.
- Headers
- Case-insensitive map of broker-message headers.
- Name
- The default
SubscriptionSource: subscribe by name string via theSubscribecapability. - Outgoing
Message - A message ready to be published, holding borrowed payload and name.
- RawMessage
- An owned snapshot of a message as it travels through the framework.
- Server
Spec - How to reach a broker, for the
serverssection of anAsyncAPIdocument.
Enums§
- AckError
- Errors returned by
IncomingMessage::ackandIncomingMessage::nack.
Traits§
- Batch
Subscriber - A subscriber that natively delivers messages in batches.
- Broker
- A connection to a message broker, owning its lifecycle.
- Describe
Server - A broker that describes itself as an
AsyncAPIserver. - Incoming
Message - A message delivered by a
Subscriber. - Message
- Metadata about a message type, used to name and describe it in an
AsyncAPIdocument. - Partitioned
- Messages or publishers that carry a routing key for broker-side partitioning.
- Publisher
- A producer that sends messages into the broker.
- Request
Reply - A publisher that supports synchronous request / reply messaging.
- Subscribe
- A broker whose subscriptions are fully determined by a name string.
- Subscriber
- A consumer attached to one or more broker names.
- Subscription
Source - A description of one subscription, resolved against a concrete broker at startup.
- Transactional
Publisher - A publisher that supports broker-side transactions.