Crate metalmq_client

Crate metalmq_client 

Source
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.
ClientError
Represents a connection or channel error. If channel is None it is a connection error.
ConsumerHandler
Consumer API for Basic.Consume.
Content
A message sent to the server or received from the server.
DeliveredMessage
A delivered message.
ExchangeDeclareOpts
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.
MessageProperties
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.
PublishedMessage
A message published by the client.
QueueDeclareOpts
Builder style helper to specify options during queue declaration.
ReturnedMessage
A message returned to the client.

Enums§

Binding
Describe the queue binding.
ConsumerSignal
A signal arriving from the server during consuming a queue.
EventSignal
Listening notifications sent by the server like channel closed or message publish acknowledged in confirm mode.
ExchangeType
Represents the exchange binding type during Queue.Bind
HeaderMatch
Describe how many headers need to be matched in case of headers binding.

Type Aliases§

ChannelNumber
AMQP channel number