Skip to main content

Crate ramqp

Crate ramqp 

Source
Expand description

ramqp — a from-scratch, clean-room AMQP 1.0 client.

This crate implements the OASIS AMQP 1.0 specification from scratch with no external AMQP dependencies: the entire type/encoding layer (codec, types) and the async runtime (transport → connection → session → link → public API → resilience) are built here on top of generic building blocks (bytes, tokio, futures).

§Design pillars

  • Single-pass, zero-copy framing. Bodies are exposed as bytes::Bytes slices; transfer/body splitting is computed once from the negotiated max-frame-size rather than by trial re-serialization.
  • Lock-free actor runtime. One owning driver task per connection holds all protocol state; user handles are cheap clones that exchange messages.
  • Flat, classified errors. One error enum per public operation with a source() chain and retry classification.
  • Pluggable observability. A Metrics trait and a connection-event stream, usable without tracing.

The crate is #![forbid(unsafe_code)].

Re-exports§

pub use api::Connection;
pub use api::ConnectionBuilder;
pub use api::Consumer;
pub use api::Producer;
pub use api::Session;
pub use resilience::Pool;
pub use resilience::PoolBuilder;
pub use transport::TlsConfig;

Modules§

api
Public API (Phase 5): the Client/Connection/Session entry points and Producer/Consumer handles, plus graceful lifecycle.
codec
Clean-room AMQP 1.0 type system and wire codec (Phase E).
config
Configuration structs and presets (WP-0.3).
connection
Connection runtime: the client’s single-owner driver task, built on the role-neutral negotiation/mux/heartbeat helpers from ramqp-core.
error
The flat, classified error model (WP-0.1, decision D-4).
ids
Identifier newtypes (WP-0.2).
link
Link runtime (Phase 4): sender/receiver state machines, owner-local settlement tracking, credit/flow control, delivery assembly, and recovery.
observe
Observability contracts (Phase 0, WP-0.4): a pluggable Metrics trait and a connection event stream, usable without the tracing ecosystem.
proto
Internal protocol command/event enums — the “alphabet” the actor layers exchange over channels (WP-0.5).
resilience
Resilience (Phase 6): the reconnect supervisor and the connection pool.
sasl
SASL authentication (WP-1.4): the client-side negotiation state machine and the ANONYMOUS / PLAIN / EXTERNAL mechanisms, plus SCRAM-SHA-1/256/512 behind the scram feature.
session
Session runtime (Phase 3): begin/end state, flow-control windows, and the handle↔link registry.
transport
Transport layer: dial-side connectors (TCP, TLS, WebSocket) over the role-neutral byte-stream/framing layer re-exported from ramqp-core.
txn
Transaction controller (clean-room, AMQP 1.0 spec part 4), behind the transaction feature.
types
Clean-room AMQP 1.0 protocol types (Phase E), built on crate::codec.

Macros§

amqp_composite
Define an AMQP composite (described-list) type with its Encode and Decode implementations from a concise field list.

Structs§

Config
The full configuration bundle.
Delivery
A received delivery. The body is exposed as raw Bytes by default; typed access is opt-in (the inversion of fe2o3-amqp’s eager-deserialize default).
Message
A complete AMQP message: optional annotation/header/property sections, a body, and an optional footer.