Expand description
NATS / JetStream broker implementation for RustStream.
The lifecycle is the framework’s ladder of consuming transitions: NatsBroker::new captures
the address synchronously, Broker::connect dials and yields a
ConnectedNatsBroker, and
ConnectedBroker::shutdown drains it into a
ClosedNatsBroker. Subscriptions and publishers exist only from the connected form.
Publishing splits by transport rather than by flag: NatsPublish pairs into the Core NATS
NatsPublisher (fire-and-forget, plus request/reply), and JetStreamPublish pairs into
the JetStreamPublisher, which awaits the stream’s acknowledgement and can state what it
expects the stream to look like.
Modules§
- context
- Optional typed per-delivery context exposing native
JetStreammetadata.
Structs§
- Closed
Nats Broker - The terminal witness returned by shutting down a
ConnectedNatsBroker. - Connected
Nats Broker - The typed witness that
Broker::connectsucceeded: holds the live connection. - Core
Message - Wrapper around an
async_nats::Messagefrom a core (non-JetStream) subscription. - JetStream
Message - Wrapper around an
async_nats::jetstream::Messagewith ack semantics. - JetStream
Publish - The
JetStreampublish policy: pure declaration, constructible anywhere. - JetStream
Publisher - The live
JetStreampublisher. Cheap to clone. - Nats
Broker - A NATS broker: configuration captured, no I/O performed yet.
- Nats
Publish - The Core NATS publish policy: pure declaration, constructible anywhere.
- Nats
Publisher - The live Core NATS publisher. Cheap to clone.
- Nats
Subscriber - A NATS subscription.
- Publish
Ack - The acknowledgement a
JetStreamstream returns for an accepted publish.PublishAckis an acknowledgment received after successfully publishing a message. - Subscribe
Options - Builder describing one subscription against a connected NATS broker (or its test counterpart).
Enums§
- Deliver
Policy DeliverPolicydetermines how the consumer should select the first message to deliver.- Nats
Error - Errors surfaced by the NATS broker implementation.
- Nats
Message - A NATS delivery. Two flavours: core NATS (no ack) and
JetStream(real ack/nack/redelivery).
Constants§
- PARTITION_
KEY_ HEADER - The well-known header key for per-message routing / partitioning.
Traits§
- Nats
Publish Policy - A publish policy that pairs with a connected NATS broker without I/O.