ruststream 0.7.0-rc.11

Async messaging framework for Rust: broker-agnostic traits, router, codecs, and a conformance harness for broker authors.
Documentation
#![doc = include_str!("README.md")]

mod app;
mod batch;
mod batch_inject;
mod batch_publishing;
pub mod cli;
mod context;
mod dispatch;
mod dynstack;
mod extract;
mod failure;
mod handle;
mod handler;
mod inject;
mod input;
mod lifecycle;
mod main_runtime;
mod metadata;
mod middleware;
#[cfg(feature = "poll-diagnostics")]
pub(crate) mod poll_diagnostics;
mod publish;
mod publish_source;
mod publishing;
mod redelivery;
mod retry;
mod router;
mod settings;
mod shutdown;
mod slot;
mod subscriber_def;
mod typed;

/// The subscriber a source opens, for broker `B` (the source resolves against the broker's
/// connected form). Tames the long projection in bounds.
pub(crate) type SourceSubscriber<B, S> =
    <S as crate::SubscriptionSource<crate::Connected<B>>>::Subscriber;

/// The message that subscriber yields. See [`SourceSubscriber`].
pub(crate) type SourceMessage<B, S> = <SourceSubscriber<B, S> as crate::Subscriber>::Message;

pub use app::{
    App, AppInfo, BrokerScope, HealthProbe, HealthState, Mounting, MountingSlots, RunningApp,
    RustStream, RustStreamError, Setup, Wired,
};
#[doc(hidden)]
pub use app::{IncludeMount, ScopeCommit};
#[cfg(feature = "testing")]
pub(crate) use app::{LifecycleHook, RegisteredBroker, Starter, TestParts};
// The definition-trait dispatch SPI the retired legacy emission used to implement in user
// crates is internal machinery now: the modules stay, but only what the crate's own mounts
// reach through this path is re-exported.
#[doc(hidden)]
pub use batch::{batch_verdict, uniform_batch};
pub use context::{After, Context};
pub use dispatch::{RETRY_COUNT_HEADER, Workers};
pub use dynstack::{DynMiddleware, DynStack, DynStackHandler, Next};
pub use extract::{Ctx, CtxKey, FromContext, FromRef, Headers, State};
pub use failure::{FailurePolicies, FailurePolicy};
#[doc(hidden)]
pub use handle::{
    Axis, AxisDocs, Batch, BatchPair, Batched, BatchedAxis, DeclaredDest, DecodeOutcome, DocState,
    Docs, HandleValue, IsDocumented, NamedDest, OneByOne, Probed, ProbedDeclaredReplyDef,
    ProbedDocs, ProbedReplyDef, ReplyValue, ResolvedDest, Sealed, Solo, SoloAxis, SoloPair,
    VerdictFamily, probed_declared_reply_def, probed_def, probed_reply_def,
};
pub use handle::{
    BatchDeserialized, Deserialized, Documentable, Documented, EncodedReply, Handle, Input,
    IntoSource, Message, OutEntry, Outs, ReplyShape, Serialized, SerializedReply, Slot,
    SoloDeserialized, Undocumented, ValueBuilder, Verdict, subscriber,
};
#[doc(hidden)]
pub use handle::{
    DeclaresReply, EntryMarkers, OutPos, RedirectableReply, ReplyDest, ReplyDestination,
    ReplyFormFor, ReplyHeadersSchema, ReplyRoute, ResolveDestination, SelectSlot,
    UnbuiltDefinition, WireDocs, declared_reply_destination, reply_destination,
};
#[doc(hidden)]
pub use handler::IntoOutcome;
pub use handler::{Handler, HandlerOutcome};
pub use main_runtime::MainRuntime;
// The status half of `HandlerOutcome`, for the crate's own policies, dispatch and test seams.
// The consumers outside `runtime` are all feature-gated (metrics, otel, testing), so a minimal
// build leaves this re-export unused.
#[allow(unused_imports)]
pub(crate) use handler::HandlerResult;
pub use inject::Out;
// Public and hidden: a hand-written low-level def (`SubscriberDef` / `BatchDef`) names its
// input kind, and the self-deserializing one is how such a def opts onto the byte transport.
#[doc(hidden)]
pub use input::Provided;
#[doc(hidden)]
pub use lifecycle::ConnectedSlot;
#[cfg(feature = "testing")]
pub(crate) use lifecycle::{BoxError, BoxFuture, ConnectedLifecycle, InProcessConnect};
pub use metadata::{HandlerMetadata, OutgoingKind, OutgoingMessageMetadata};
pub use middleware::{BlanketLayer, HandlerExt, Identity, Layer, Stack, layers};
#[cfg(feature = "poll-diagnostics")]
pub use poll_diagnostics::{PollDiagnostics, PollReport};
// The reply wiring a mount site's chain builds, the live sinks it pairs into, and the step traits
// the chain resolves through: the chain names them for the user, so none of it is spelled in
// service code.
#[doc(hidden)]
pub use publish::{
    AddBatchReplyTransform, AddReplyTransform, Admits, AnyDeclared, CodecSlotOpen,
    DestinationSettled, DestinationUse, Direct, Either, EncodeOutcome, FitsOffer, FitsTaken,
    InTransaction, LowerOutTransforms, MapReplyPolicy, NameReplyCodec, NamedDestinationSend,
    NamesDestination, NamingOffered, NamingUntaken, NarrowToUse, PayloadError, PublishingDirectly,
    RawReplyWiring, ReplyPublisher, ReplyWiring, SendOnlyPolicy, SlotStackUse, SlotTransforms,
    Transactional, TransactionalReply, TypedPublisher, WireBytes, WirePayload,
};
pub use publish::{
    BatchPublishTransform, BatchPublishTransformStack, BatchTransformIdentity, BoundSegment,
    CallCodec, ContextKind, EncodedWire, ForBatch, ForReply, ForSlot, HeaderSource, HeadersUnset,
    MapHeaders, MessageBody, MessageWire, MissingSegment, Names, OutPipeline, Outgoing,
    OutgoingName, PipelinePublishError, PublishAt, PublishBuilder, PublishCodec, PublishContext,
    PublishDynLayer, PublishDynNext, PublishDynStack, PublishError, PublishExt, PublishHeaders,
    PublishIdentity, PublishLayer, PublishNext, PublishPipeline, PublishSink, PublishStack,
    PublishTransform, PublishTransformIdentity, PublishTransformStack, Reads, ResolvedName,
    SatisfiesContract, SerializePayloadError, SerializedWire, SlotContext, SuppliedName,
    TemplateAddress, TransactionPublishError, TransactionScope, TypedHeaders, TypedTransaction,
    UnnamedCodec, for_batch,
};
// The builder's entry point, for the surfaces outside `runtime` that offer one: the test harness
// injects through the same positions as a live publish.
#[cfg(feature = "testing")]
pub(crate) use publish::message_of;
pub use publish_source::{Bindable, Bound, BrokerRegistration};
#[doc(hidden)]
pub use redelivery::{
    CopiesAddressed, CopyPathAddress, CopyPathPairing, PublishesCopiesHere, RetryPairing,
    RetrySetup,
};
pub use retry::Retry;
#[doc(hidden)]
pub use retry::{
    Absent, CapOpen, DeadLetterOpen, DeclareCap, DeclareDeadLetter, DeclareMount, Declaring,
    DestinationDeclared, DestinationLast, DestinationOpen, DestinationUndeclared, FixedDestination,
    OpenDestination, Present, Retried, RetryChain, RetryMount, RetryOffer, RetryOpen, RetryPos,
    RetryStackUse, RouteDeclaring, RoutePosition, SettlesDestination, StepOpen, StepTaken,
};
#[doc(hidden)]
pub use router::{
    AttachDeclaration, AttachRetry, BatchPublishInjectMount, BatchPublishMount, DefaultReply,
    PublishInjectMount, PublishMount, RawReplyInjectMount, RawReplyMount, ReplyAttachment,
    RetryDestinationsDeclared, RouteMetadata, RouteSubscription, RouterBroker, RouterCommit,
    RouterMount,
};
pub use router::{
    IncludeDef, MapPublisher, Router, RouterDef, RouterHandlers, RouterOut, RouterPublishing,
    RouterPublishingOut, RouterSink, RouterWith, forms,
};
pub use settings::{
    AllOpen, BatchSized, BatchStep, Declared, FailureStep, Fixed, MapSourceStep, NameStep, Open,
    StartAtStep, SubscriberBuilder, SubscriberSettings, WorkersStep,
};
#[doc(hidden)]
pub use settings::{CapsBatches, DefinitionInputCodec, MountsWith};
#[cfg(feature = "testing")]
pub(crate) use shutdown::Shutdown;
#[doc(hidden)]
pub use slot::{
    AdmitsAt, AdmitsSlotAt, BatchTransformLast, BindAt, BindSlot, Both, CodecAt, CodecLast,
    DestinationOffer, InitSlots, IntoSlotSource, MapPolicyAt, MapPolicyLast, MissingSlot,
    MountOffer, NamedStep, NoOutBound, NoReply, OutAttachment, OutPosition, PositionOptions,
    ReplyLast, ReplyOffer, ReplyOpen, ReplyStep, SlotCodec, SlotPolicy, SlotPos, TransactionalLast,
    TransformAt, TransformLast, WithSource,
};
pub use slot::{
    BindSlots, ContainsMessage, DefaultSlot, HasSlots, ListOffer, OutMessages, OutSlot,
    PublishedThrough, Reply, SlotPublisher, Unrestricted,
};
pub use typed::{Typed, typed};