fe2o3_amqp_types/definitions/
mod.rs

1//! Types defined in AMQP 1.0 specification Part 2.8: Definitions
2
3use serde::{Deserialize, Serialize};
4use serde_bytes::ByteBuf;
5
6use serde_amqp::{
7    primitives::{OrderedMap, Symbol, Uint},
8    value::Value,
9};
10
11/// 2.8.1 Role
12mod role;
13pub use role::Role;
14
15/// 2.8.2 Sender Settle Mode
16mod snd_settle_mode;
17pub use snd_settle_mode::SenderSettleMode;
18
19/// 2.8.3 Receiver Settle Mode
20mod rcv_settle_mode;
21pub use rcv_settle_mode::ReceiverSettleMode;
22
23/// 2.8.4 Handle
24#[derive(Debug, Clone, PartialEq, Eq, PartialOrd, Ord, Deserialize, Serialize)]
25pub struct Handle(pub Uint);
26
27impl Default for Handle {
28    fn default() -> Self {
29        Handle(u32::MAX)
30    }
31}
32
33impl From<Uint> for Handle {
34    fn from(val: Uint) -> Self {
35        Self(val)
36    }
37}
38
39impl From<Handle> for Uint {
40    fn from(val: Handle) -> Self {
41        val.0
42    }
43}
44
45/// 2.8.5 Seconds
46pub type Seconds = Uint;
47
48/// 2.8.6 Milliseconds
49pub type Milliseconds = Uint;
50
51/// 2.8.7 Delivery Tag
52/// A delivery-tag can be up to 32 octets of binary data
53pub type DeliveryTag = ByteBuf;
54
55/// 2.8.8 Delivery Number
56pub type DeliveryNumber = SequenceNo;
57
58/// 2.8.9 Transfer Number
59pub type TransferNumber = SequenceNo;
60
61/// 2.8.10 Sequence No
62pub type SequenceNo = Uint;
63
64/// 2.8.11 Message Format
65pub type MessageFormat = Uint;
66
67/// 2.8.12 IETF Language Tag
68pub type IetfLanguageTag = Symbol;
69
70/// 2.8.13 Fields
71pub type Fields = OrderedMap<Symbol, Value>;
72
73/// 2.8.14 Error
74mod error;
75pub use error::Error;
76
77mod error_cond;
78pub use error_cond::ErrorCondition;
79
80/// 2.8.15 AMQP Error
81mod amqp_error;
82pub use amqp_error::AmqpError;
83
84/// 2.8.16 Connection Error
85mod conn_error;
86pub use conn_error::ConnectionError;
87
88/// 2.8.17 Session Error
89mod session_error;
90pub use session_error::SessionError;
91
92/// 2.8.18 Link Error
93mod link_error;
94pub use link_error::LinkError;
95
96/// 2.8.19 Constant definition
97mod constant_def;
98pub use constant_def::{MAJOR, MINOR, MIN_MAX_FRAME_SIZE, PORT, REVISION, SECURE_PORT};