Expand description
Application object, middleware and dispatch.
Re-exports§
pub use crate::Extensions;
Modules§
- cli
- The process entry point generated by
#[ruststream::app]. - layers
- Bundled, opinionated middleware layers ready to drop into a handler stack.
Structs§
- After
- A builder for an outcome-gated post-settle hook, returned by
Context::after. - AppInfo
- Service-level metadata, surfaced to the
AsyncAPIgenerator as the specInfoobject. - Batch
Publishing Handler - The
BatchHandlerbuilt from aBatchPublishingDef: decode the batch, run the handler, publish the replies through theReplyPublisher, then ack the batch. - Broker
Scope - A handler-registration scope bound to one broker.
- Context
- Per-delivery context, threaded through middleware and into the handler.
- DynStack
- A
Layerthat runs a frozen list ofDynMiddlewarebefore the handler it wraps. - DynStack
Handler - Handler produced by
DynStack::layer. Runs the frozen middleware chain, then the wrapped handler. - Failure
Policies - The pair of failure policies a subscriber carries: one for a handler panic, one for a decode
failure. Threaded from the def to the dispatch loop alongside the
Workerspolicy. - Handler
Metadata - Descriptive metadata for a registered subscriber handler.
- Identity
- The identity
Layer: returns the handler unchanged. The default global stack onRustStream. - Next
- A cursor over the remaining middleware in a
DynStack, ending in the wrapped handler. - Outgoing
- A mutable outgoing message flowing through the publish pipeline.
- Publish
Identity - The no-op
PublishLayer: the default for aTypedPublisherwith no static transforms. - Publish
Next - A cursor over the remaining publish middleware, ending in the broker publisher.
- Publish
Stack - Composes two
PublishLayers:innerruns first, thenouter. Built byTypedPublisher::layer; you rarely name it directly. - Publishing
Handler - The
Handlerbuilt from aPublishingDef: decode, run, encode the reply, publish, ack. - Router
- A statically-typed, lazily-bound group of handler registrations, not attached to any broker.
- Router
Sink - The runtime collector a router mounts into: type-erased starters plus handler metadata.
- Rust
Stream - The top-level application object.
- Scoped
Publisher - A named publisher resolved from a
Context, sending through the scope’s publish pipeline. - Settle
- The settlement of one dispatched message: the
HandlerResultoutcome the dispatcher acts on, plus an optional post-settle continuation. - Stack
- Composes two layers into one:
inneris applied first (innermost),outerwraps it. - State
- App-level shared state: a type-map holding one value per type.
- Transactional
- A
TypedPublisherwhose batch replies are published inside one broker transaction. - Typed
- Handler produced by
typed. Override the decode-failure policy withTyped::on_decode_failure. - Typed
Batch - The decode adapter for batches, the
Typedcounterpart. - Typed
Publisher - A byte
Publisherpaired with aCodecand a staticPublishLayerstack, ready to send typed values. - Workers
- Concurrency policy for one subscriber’s dispatch loop, declared with the
workers(..)macro argument (orWorkers::sequentialby default).
Enums§
- Batch
Result - The settlement of one dispatched batch.
- Failure
Policy - What a subscriber does when it cannot process a message.
- Handler
Result - What the router should do with the message after the handler returns.
- Rust
Stream Error - Errors surfaced while running a
RustStreamservice.
Constants§
- RETRY_
COUNT_ HEADER - Header carrying the framework’s deferred-republish retry count.
Traits§
- Batch
Def - A batch handler definition produced by
#[subscriber(batch(..))]. - Batch
Publishing Def - A batch subscriber definition that produces replies to publish.
- Blanket
Layer - A
Layerthat wraps a handler on any message type, not one fixedH. - DynMiddleware
- A middleware in the around / next style, operating on a borrowed input
Iand itsContext. - Erased
Publisher - A publisher with its concrete type and error erased.
- Handler
- A handler invoked on each input it is given.
- Handler
Ext - Convenience extension trait for fluent layer stacking on any
Handler. - Into
Batch Result - Conversion into a
BatchResult, so#[subscriber(batch(..))]handlers can return a plain value. - Into
Settle - Conversion into a
Settle, so#[subscriber]handlers can return a plain value instead of always constructing one. - Layer
- A function from one handler to another. Apply with
HandlerExt::with. - Publish
Layer - A static, compile-time publish transform: mutates an
Outgoingbefore it is sent. - Publish
Middleware - Middleware that transforms (or observes) an
Outgoingmessage before it is published. - Publishing
Def - A subscriber definition that produces a reply to publish.
- Reply
Publisher - The reply wiring accepted by the
include_batch_publishingmounts. - Router
Def - A mountable group of handler registrations.
- Slice
Handler - A handler invoked with one whole decoded batch.
- Subscriber
Def - A handler definition produced by the
#[subscriber]macro.
Functions§
- typed
- Build a
Handler<M>that decodes the payload withcodecintoTand forwards&Ttoinner.