Skip to main content

amq_protocol/
lib.rs

1#![deny(missing_docs, missing_debug_implementations, unsafe_code)]
2#![warn(unreachable_pub, unused_qualifications, unused_lifetimes)]
3#![warn(
4    clippy::must_use_candidate,
5    clippy::unwrap_in_result,
6    clippy::panic_in_result_fn
7)]
8
9//! AMQP 0-9-1 protocol codec for Rust.
10//!
11//! This crate is the main entry point for the `amq-protocol` workspace. It
12//! re-exports the [`tcp`], [`types`], and [`uri`] sub-crates and provides the
13//! code-generated [`protocol`] module (produced from the RabbitMQ spec), plus
14//! [`auth`] helpers and [`frame`] serialisation/deserialisation utilities.
15//!
16//! # Feature flags
17//!
18//! ## Async runtime (pick exactly one)
19//!
20//! | Flag | Notes |
21//! |------|-------|
22//! | `tokio` *(default)* | Requires a running Tokio runtime |
23//! | `smol` | Uses the smol executor |
24//! | `async-global-executor` | Uses async-global-executor |
25//!
26//! ## TLS backend (pick at most one; `rustls` is the default)
27//!
28//! | Flag | Notes |
29//! |------|-------|
30//! | `rustls` *(default)* | TLS via rustls |
31//! | `native-tls` | TLS via the platform's native library |
32//! | `openssl` | TLS via OpenSSL |
33//!
34//! ## Rustls certificate store (only when `rustls` is active)
35//!
36//! | Flag | Notes |
37//! |------|-------|
38//! | `rustls-platform-verifier` *(default)* | Uses the platform trust store |
39//! | `rustls-native-certs` | Loads native root certificates |
40//! | `rustls-webpki-roots-certs` | Uses the webpki bundled root set |
41//!
42//! ## Rustls crypto provider (at least one must be enabled)
43//!
44//! | Flag | Notes |
45//! |------|-------|
46//! | `rustls--aws_lc_rs` *(default)* | Uses aws-lc-rs |
47//! | `rustls--ring` | Uses ring (more portable) |
48//!
49//! ## Miscellaneous
50//!
51//! | Flag | Notes |
52//! |------|-------|
53//! | `codegen` | Force protocol code regeneration at build time |
54//! | `verbose-errors` | More detailed AMQP parser error messages |
55//! | `hickory-dns` | Use hickory-dns for name resolution |
56
57/// TCP/TLS connection helpers (re-export of `amq-protocol-tcp`).
58pub use amq_protocol_tcp as tcp;
59/// AMQP type system and wire-format codec (re-export of `amq-protocol-types`).
60pub use amq_protocol_types as types;
61/// AMQP URI parsing (re-export of `amq-protocol-uri`).
62pub use amq_protocol_uri as uri;
63
64/// SASL authentication helpers for AMQP connections.
65pub mod auth;
66/// AMQP frame serialisation and deserialisation.
67pub mod frame;
68/// Code-generated AMQP 0-9-1 method and property types derived from the RabbitMQ spec.
69pub mod protocol;