Expand description
AMQP 0.9 compatible async client based on Tokio.
§Usage
Add the following to your Cargo.toml
[dependencies]
metalmq-client = "0.2.2"And then from an async function you can connect to an AMQP server.
use metalmq_client::Client;
async fn send_message() {
let mut client = Client::connect("localhost:5672", "guest", "guest").await.unwrap();
client.channel_open(1).await.unwrap();
client.close().await.unwrap();
}Macros§
- client_
error - Shorthand for creating errors in async functions.
Structs§
- Channel
- A channel is the main method of communicating with an AMQP server. Channels can be created on
an open connection by calling the [
Client.channel_open] function. - Client
- The AMQP client instance which reprensents an open connection.
- Client
Error - Represents a connection or channel error. If
channelisNoneit is a connection error. - Consumer
Handler - Consumer API for
Basic.Consume. - Content
- A message sent to the server or received from the server.
- Delivered
Message - A delivered message.
- Exchange
Declare Opts - Options for declaring exchanges.
- Exclusive
- Specify if the consume is exclusive aka no other client can consume the queue.
- IfEmpty
- Condition for stating that queue can be deleted if it is empty, doesn’t have messages.
- IfUnused
- Condition for deleting an exchange or a queue if they don’t have active consumers.
- Message
Properties - NoAck
- Specify if the client needs to ack messages after delivery.
- NoLocal
- Specify if the server sends messages to the same connection which published them.
- Published
Message - A message published by the client.
- Queue
Declare Opts - Builder style helper to specify options during queue declaration.
- Returned
Message - A message returned to the client.
Enums§
- Binding
- Describe the queue binding.
- Consumer
Signal - A signal arriving from the server during consuming a queue.
- Event
Signal - Listening notifications sent by the server like channel closed or message publish acknowledged in confirm mode.
- Exchange
Type - Represents the exchange binding type during
Queue.Bind - Header
Match - Describe how many headers need to be matched in case of headers binding.
Type Aliases§
- Channel
Number - AMQP channel number