Rust API
The Rust crate is postgremq. Use docs.rs for the versioned public API, including connections, consumer streams, handlers, deliveries, options, and errors.
Current documentation baseline: 0.4.0, requiring Rust 1.94 or later.
cargo add postgremq@=0.4.0
Open the 0.4.0 crate reference. PostgreMQ uses Tokio and SQLx and reexports its SQLx and serde_json dependencies for compatible transaction and JSON types.
The optional otel feature enables the meter-provider API for Application metrics. It provides instrumentation hooks, not an exporter or an application-owned telemetry SDK. Keep the provider alive until queue shutdown has completed.
Start with Connecting, Publishing, and Consuming. Stream consumption returns a Delivery; handler consumers accept callbacks returning a result and an optional concurrency limit.
Dropping an unsettled delivery does not acknowledge it. Observe stopped() for cancellation and use explicit settlement or the handler contract. See Acknowledgements, Visibility timeouts, and Graceful shutdown.
SQL and Rust releases are independent. Check Compatibility when combining them, and use docs.rs's released-version navigation for older crate APIs.