Skip to main content

hopf_amqp/
lib.rs

1// Copyright (C) 2026 Chris Burdess <dog@gnu.org>
2
3//! AMQP 0-9-1 async client for Hopf (RabbitMQ).
4//!
5//! Client-only: dial a broker, publish opaque message bodies with basic
6//! properties — either whole via `basic.publish`, or streamed in pieces
7//! via `basic.publish-start`/`basic.publish-body` for large bodies the
8//! caller doesn't want to materialize as one contiguous buffer — and
9//! consume via push `basic.consume` deliveries or pull `basic.get`. Also
10//! supports classic AMQP transactions (`tx.*`), channel flow control,
11//! `basic.recover`, PLAIN / AMQPLAIN / EXTERNAL SASL (auto-negotiated, or
12//! forced via [`client::AmqpClient::mechanism`]), and automatic
13//! reconnection with topology/consumer replay via
14//! [`client::AmqpRecoveringClient`]. There is no broker implementation in
15//! this crate.
16//!
17//! # Layout
18//!
19//! - [`codec`] — frame encode/decode, field tables, basic properties, push parser
20//! - [`client`] — facade, endpoint, Control / Driver SPI
21
22#![warn(missing_docs)]
23
24pub mod client;
25pub mod codec;
26
27#[cfg(all(test, feature = "integration"))]
28mod integration;
29
30/// Crate version string from `Cargo.toml`.
31pub const VERSION: &str = env!("CARGO_PKG_VERSION");
32
33#[cfg(test)]
34mod tests {
35    use super::VERSION;
36
37    #[test]
38    fn version_is_nonempty() {
39        assert!(!VERSION.is_empty());
40    }
41}