Expand description
Strut
Backend in Rust: convenient and configurable with Strut. 🏗️
- Strut is a Rust application scaffold that aims to simplify common backend chores.
- The documentation is available on the ➡️ homepage.
§Crate strut-rabbitmq
⚠️ Internal crate
Unless you know exactly what you are doing, there is probably no need to directly depend on this crate.
This crate is a convenience layer around lapin crate.
Modules§
- util
- Exposes convenience layers around
lapintypes.
Structs§
- Batch
Publishing Error - Represents a (partially) failed publishing of a batch of RabbitMQ messages.
- Connector
- Runs in the background, maintains no more than one active connection to a
RabbitMQ cluster (referred to herein as current connection) identified
by the given
Handle. Exposes a cheaply clone-ableGateway, which any number of asynchronous tasks can use to retrieve a freshChannelcreated in the current connection. - Custom
Exchange - Defines a custom RabbitMQ exchange, as opposed to any built-in variants.
- Declaration
Error - Represents failure to issue at least one of the declarations that are required before the subscriber can start consuming messages.
- Dispatch
- Represents an outgoing RabbitMQ message.
- Dispatch
Builder - Allows building an outgoing RabbitMQ
Dispatchiteratively. - DsnChunks
- Groups the pieces of a RabbitMQ DSN for convenient passing into
Handle::new. - Egress
- Defines an outbound path for messages being sent into a RabbitMQ cluster.
- Egress
Builder - Builds an
Egressincrementally and validates it on the final stage. - Egress
Landscape - Represents a collection of uniquely named
Egressdefinitions. - Envelope
- Represents an incoming RabbitMQ message.
- Exchange
Builder - Builds an
Exchangeincrementally and validates it on the final stage. - Gateway
- An asynchronous gateway to creating and retrieving fresh
Channels on an internally maintainedConnection. - Handle
- Defines a connection handle for a RabbitMQ cluster, consisting primarily of a set of credentials, along with a bit of metadata for logging/debugging purposes.
- Handle
Collection - Represents a collection of uniquely named
Handles. - Ingress
- Defines an inbound path for messages being consumed from a RabbitMQ cluster.
- Ingress
Builder - Temporary struct for accumulating ingress configuration before finalizing it
into a
Ingress. This builder intends to apply validation only at meaningful states of the configuration, as opposed to every intermediary state. - Ingress
Landscape - Represents a collection of uniquely named
Ingressdefinitions. - NonEmpty
- Non-empty vector.
- Noop
Decoder - In some cases it is not necessary or not desirable to decode the incoming
message’s bytes on consumption. This convenience implementation of
Decoderenables such cases by not doing anything and returning a unit type(). - Publisher
- Publishes outgoing
Dispatches to the RabbitMQ cluster. - Publishing
Error - Represents a failed publishing of a single RabbitMQ message.
- Queue
- Defines of a RabbitMQ queue to be declared from the consuming side.
- Rabbit
MqConfig - Represents the application-level configuration section that covers everything related to RabbitMQ connectivity:
- String
Decoder - Implements
Decoderthat allocates an owned UTF-8Stringwith a copy of the given bytes. This decoder fails withFromUtf8Errorif the given bytes cannot be interpreted as valid UTF-8. - Subscriber
- Receives incoming
Envelopes from the RabbitMQ cluster, passing them through a pre-setDecoderbefore returning to the caller.
Enums§
- Acking
Behavior - Defines how the consumed messages are acknowledged: explicitly or implicitly.
- Confirmation
Level - Defines the extent to which the message
Publishershould confirm successful sending. - Delivery
Mode - Defines whether RabbitMQ persists the messages to disk, which affects whether such messages are able to survive a broker restart.
- Egress
Error - Represents the various error states of a RabbitMQ egress definition.
- Exchange
- Defines a RabbitMQ exchange to be used in definitions related to RabbitMQ routing.
- Exchange
Error - Represents the various error states that may arise when a RabbitMQ exchange definition becomes invalid.
- Exchange
Kind - Represents the supported kinds of RabbitMQ exchanges.
- Finalization
Kind - Represents the supporting ways of finalizing an incoming RabbitMQ message.
Relevant only when the inbound messages are set to be
manually acknowledged on the
Ingress. - Header
- Represents the value assigned to a RabbitMQ header, specifically the binding
header. This enumeration is used for deserializing
Ingressdefinitions. - Headers
Matching Behavior - Defines the matching behavior for the
Headerskind of exchange. Irrelevant for all other kinds of exchanges. - Ingress
Error - Represents the various error states of a RabbitMQ ingress definition.
- Publishing
Failure - Explains what exactly went wrong in publishing a single RabbitMQ message.
- Queue
Kind - Defines a RabbitMQ queue kind, which is currently limited to either classic or quorum queues. See the RabbitMQ documentation for details.
- Queue
Renaming Behavior - Defines optional queue renaming behavior. Values other than
Verbatimtrigger appending of a suffix to the user-provided queue name.
Constants§
- EXCHANGE_
AMQ_ DIRECT - Name of the RabbitMQ built-in
amq.directexchange - EXCHANGE_
AMQ_ FANOUT - Name of the RabbitMQ built-in
amq.fanoutexchange - EXCHANGE_
AMQ_ HEADERS - Name of the RabbitMQ built-in
amq.headersexchange - EXCHANGE_
AMQ_ MATCH - Name of the RabbitMQ built-in
amq.matchexchange - EXCHANGE_
AMQ_ TOPIC - Name of the RabbitMQ built-in
amq.topicexchange - EXCHANGE_
DEFAULT - Name of the RabbitMQ built-in default exchange
Traits§
- Decoder
- Represents a way of decoding a payload of an incoming message (which is received as a sequence of bytes) into an arbitrary result type.
- Envelope
Stack - Represents a collection of
Envelopes that can be acted upon with included convenience methods.
Functions§
- strut_
shutdown - Re-exports the
strut_shutdownfunction to facilitate stand-alone usage of this crate.
Type Aliases§
- Batch
Publishing Result - Shorthand for a result of a batch publishing attempt.
- Publishing
Result - Shorthand for a result of a single publishing attempt.
- String
Subscriber - Shorthand for a
Subscriberthat decodes messages intoStrings. - Undecoded
Subscriber - Shorthand for a
Subscriberthat does not decode consumed messages.