1pub mod codec;
2pub(crate) mod collation;
3mod context;
4pub mod numeric;
5pub mod stream;
6pub mod time;
7pub mod xml;
8
9pub(crate) use collation::*;
10pub(crate) use context::*;
11pub(crate) use numeric::*;
12
13pub(crate) const HEADER_BYTES: usize = 8;
15
16uint_enum! {
17 #[repr(u8)]
19 pub enum EncryptionLevel {
20 Off = 0,
22 On = 1,
24 NotSupported = 2,
26 Required = 3,
28 Strict = 4,
31 }
32
33}
34
35impl EncryptionLevel {
36 pub(crate) fn as_wire_value(&self) -> u8 {
42 match self {
43 EncryptionLevel::Strict => EncryptionLevel::Required as u8,
44 other => *other as u8,
45 }
46 }
47}
48
49#[cfg(test)]
50mod tests {
51 use super::*;
52
53 #[test]
54 fn encryption_level_as_wire_value() {
55 assert_eq!(EncryptionLevel::Off.as_wire_value(), 0);
56 assert_eq!(EncryptionLevel::On.as_wire_value(), 1);
57 assert_eq!(EncryptionLevel::NotSupported.as_wire_value(), 2);
58 assert_eq!(EncryptionLevel::Required.as_wire_value(), 3);
59 assert_eq!(EncryptionLevel::Strict.as_wire_value(), 3);
60 }
61}