Skip to main content

qubit_event_bus/
lib.rs

1/*******************************************************************************
2 *
3 *    Copyright (c) 2026 Haixing Hu.
4 *
5 *    SPDX-License-Identifier: Apache-2.0
6 *
7 *    Licensed under the Apache License, Version 2.0.
8 *
9 ******************************************************************************/
10//! # Qubit Event Bus
11//!
12//! A lightweight, thread-safe in-process event bus for Rust.
13//!
14// qubit-style: allow coverage-cfg
15
16#![deny(missing_docs)]
17
18mod core;
19mod local;
20mod transactional;
21
22pub use core::{
23    AckMode,
24    Acknowledgement,
25    AttemptTimeoutOption,
26    AttemptTimeoutPolicy,
27    BatchPublishFailure,
28    BatchPublishResult,
29    DeadLetterOriginalPayload,
30    DeadLetterPayload,
31    DeadLetterRecord,
32    DeadLetterStrategy,
33    DeadLetterStrategyAny,
34    DeadLetterStrategyAnyCallback,
35    DeadLetterStrategyCallback,
36    EventBus,
37    EventBusError,
38    EventBusFactory,
39    EventBusResult,
40    EventEnvelope,
41    EventEnvelopeBuilder,
42    EventEnvelopeMetadata,
43    IntoEventBusResult,
44    PublishOptions,
45    PublishOptionsBuilder,
46    RetryDelay,
47    RetryJitter,
48    RetryOptions,
49    SubscribeOptions,
50    SubscribeOptionsBuilder,
51    Subscription,
52    Topic,
53    TopicKey,
54    discard_dead_letters,
55    prefixed_dead_letters,
56    standard_dead_letters_to,
57};
58#[cfg(coverage)]
59pub use core::{
60    coverage_exercise_core_defensive_paths,
61    coverage_exercise_event_bus_factory_default_regions,
62};
63pub use local::{
64    IntoPublisherInterceptorAnyResult,
65    IntoPublisherInterceptorResult,
66    LocalEventBus,
67    LocalEventBusFactory,
68    PublisherInterceptor,
69    PublisherInterceptorAny,
70    SubscriberInterceptor,
71    SubscriberInterceptorAny,
72    SubscriberInterceptorAnyChain,
73    SubscriberInterceptorChain,
74};
75#[cfg(coverage)]
76pub use local::{
77    coverage_exercise_local_event_bus_defensive_paths,
78    coverage_exercise_local_event_bus_inner_defensive_paths,
79    coverage_exercise_subscriber_interceptor_chain_defensive_paths,
80};
81pub use transactional::{
82    StagedEvent,
83    StagedEventEnvelope,
84    TransactionalEventBus,
85    TransactionalPublisher,
86    UnsupportedTransactionalEventBus,
87    UnsupportedTransactionalPublisher,
88};