Skip to main content

mq_bridge/
lib.rs

1//  mq-bridge
2//  © Copyright 2025, by Marco Mengelkoch
3//  Licensed under MIT License, see License file for more details
4//  git clone https://github.com/marcomq/mq-bridge
5pub mod canonical_message;
6pub mod command_handler;
7pub mod endpoints;
8pub mod errors;
9pub mod event_handler;
10pub mod event_store;
11pub mod extensions;
12pub mod middleware;
13pub mod models;
14pub mod outcomes;
15pub mod publisher;
16pub mod response;
17pub mod route;
18#[cfg(feature = "test-utils")]
19pub mod test_utils;
20pub mod traits;
21pub mod type_handler;
22
23pub use anyhow;
24pub use canonical_message::{CanonicalMessage, MessageContext};
25pub use errors::HandlerError;
26pub use models::Route;
27pub use outcomes::{Handled, Received, ReceivedBatch, Sent, SentBatch};
28pub use publisher::Publisher;
29
30pub use endpoints::memory::get_or_create_channel;
31pub use publisher::{get_publisher, list_publishers, register_publisher, unregister_publisher};
32pub use route::{get_route, list_routes, register_endpoint, stop_route};
33
34pub mod consumer {
35    pub use crate::middleware::apply_middlewares_to_consumer as apply_middlewares;
36}
37
38/// The application name, derived from the package name in Cargo.toml.
39pub const APP_NAME: &str = env!("CARGO_PKG_NAME");