strut_rabbitmq/
lib.rs

1#![doc = include_str!("../README.md")]
2#![deny(missing_docs)]
3#![cfg_attr(test, deny(warnings))]
4
5/// Exposes an application configuration section.
6mod config;
7pub use self::config::RabbitMqConfig;
8
9/// Exposes a handle for defining a set of connection credentials.
10mod handle;
11pub use self::handle::{DsnChunks, Handle, HandleCollection};
12
13/// Exposes various types for defining outbound and inbound message routes.
14mod routing {
15    pub mod egress;
16    pub mod exchange;
17    pub mod ingress;
18}
19
20// Re-export routing types
21pub use self::routing::egress::{Egress, EgressBuilder, EgressError, EgressLandscape};
22pub use self::routing::exchange::{CustomExchange, Exchange, ExchangeBuilder, ExchangeError};
23pub use self::routing::ingress::queue::Queue;
24pub use self::routing::ingress::{Ingress, IngressBuilder, IngressError, IngressLandscape};
25
26/// Exposes machinery for maintaining a connection to a RabbitMQ cluster.
27mod connector;
28pub use self::connector::{Connector, Gateway};
29
30/// Exposes machinery for transporting incoming and outgoing messages.
31mod transport {
32    pub mod inbound;
33    pub mod outbound;
34}
35
36// Re-export inbound types
37pub use self::transport::inbound::decoder::{Decoder, NoopDecoder, StringDecoder};
38pub use self::transport::inbound::envelope::{stack::EnvelopeStack, Envelope};
39pub use self::transport::inbound::subscriber::{
40    DeclarationError, StringSubscriber, Subscriber, UndecodedSubscriber,
41};
42
43// Re-export inbound types (JSON-related)
44#[cfg(feature = "json")]
45pub use self::transport::inbound::decoder::JsonDecoder;
46#[cfg(feature = "json")]
47pub use self::transport::inbound::subscriber::JsonSubscriber;
48
49// Re-export outbound types
50pub use self::transport::outbound::dispatch::{Dispatch, DispatchBuilder};
51pub use self::transport::outbound::publisher::api::{
52    BatchPublishingError, BatchPublishingResult, PublishingError, PublishingFailure,
53    PublishingResult,
54};
55pub use self::transport::outbound::publisher::Publisher;
56
57// Re-export [`NonEmpty`] as it is part of this crate’s API.
58pub use nonempty::NonEmpty;
59
60/// Exposes convenience layers around `lapin` types.
61pub mod util {
62    mod amqp_properties;
63    pub use self::amqp_properties::push::{
64        PushAppId, PushClusterId, PushContentEncoding, PushContentType, PushCorrelationId,
65        PushExpiration, PushHeader, PushKind, PushMessageId, PushReplyTo, PushUserId,
66    };
67    pub use self::amqp_properties::retrieve::{
68        RetrieveAppId, RetrieveClusterId, RetrieveContentEncoding, RetrieveContentType,
69        RetrieveCorrelationId, RetrieveExpiration, RetrieveHeader, RetrieveKind, RetrieveMessageId,
70        RetrieveReplyTo, RetrieveUserId,
71    };
72    pub use self::amqp_properties::RetrievePushMap;
73
74    mod amqp_value;
75    pub use self::amqp_value::IsEmpty;
76
77    mod coerce;
78    pub use self::coerce::Coerce;
79
80    mod field_table;
81    pub use self::field_table::push::Push;
82    pub use self::field_table::retrieve::Retrieve;
83    pub use self::field_table::{Attempt, HEADER_ATTEMPT};
84
85    mod morph;
86    pub use self::morph::Morph;
87}
88
89/// Exposes the domain enumerations that are used to encode the underlying
90/// configuration and routing logic.
91mod repr {
92    pub mod delivery;
93    pub mod egress;
94    pub mod ingress;
95}
96pub use self::repr::delivery::{DeliveryMode, FinalizationKind};
97pub use self::repr::egress::ConfirmationLevel;
98pub use self::repr::ingress::exchange::{
99    ExchangeKind, EXCHANGE_AMQ_DIRECT, EXCHANGE_AMQ_FANOUT, EXCHANGE_AMQ_HEADERS,
100    EXCHANGE_AMQ_MATCH, EXCHANGE_AMQ_TOPIC, EXCHANGE_DEFAULT,
101};
102pub use self::repr::ingress::header::Header;
103pub use self::repr::ingress::queue::{QueueKind, QueueRenamingBehavior};
104pub use self::repr::ingress::{AckingBehavior, HeadersMatchingBehavior};
105
106/// Re-exports the `strut_shutdown` function to facilitate stand-alone usage of
107/// this crate.
108///
109/// When using this crate without the `strut` crate itself, await on this
110/// function as a last thing before completing the main application logic.
111pub use strut_core::strut_shutdown;