strut_rabbitmq/repr/egress.rs
1use strut_factory::Deserialize as StrutDeserialize;
2
3/// Defines the extent to which the message [`Publisher`](crate::Publisher)
4/// should confirm successful sending.
5///
6/// If the confirmation level is set to the
7/// [lowest level](ConfirmationLevel::Transmitted), then the confirmation of the
8/// message is going-to be a no-op, without any network communication. If,
9/// however, the confirmation level is anywhere higher, the confirmation is
10/// performed against the RabbitMQ broker asynchronously, and the publishing
11/// implicitly switches to at-least-once publishing guarantee, which means that
12/// some of the messages may be published multiple times.
13#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash, StrutDeserialize)]
14#[strut(eq_fn = strut_deserialize::Slug::eq_as_slugs)]
15pub enum ConfirmationLevel {
16 /// Ensures network transmission.
17 #[strut(alias = "transmit")]
18 Transmitted,
19
20 /// Ensures network transmission **and** exchange existence.
21 #[strut(alias = "accept")]
22 Accepted,
23
24 /// Ensures network transmission **and** exchange existence **and** routing to a queue.
25 #[strut(alias = "route")]
26 Routed,
27}