1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
use speedy::{Readable, Writable};

/// Type for DDS Topic (Keyed or No key)
#[derive(Debug, Clone, Copy, PartialEq, Eq, Readable, Writable)]
#[repr(u32)]
pub enum TopicKind {
  NoKey = 1,
  WithKey = 2,
}

#[cfg(test)]
mod tests {
  use super::*;

  serialization_test!(type = TopicKind,
  {
      topic_kind_no_key,
      TopicKind::NoKey,
      le = [0x01, 0x00, 0x00, 0x00],
      be = [0x00, 0x00, 0x00, 0x01]
  },
  {
      topic_kind_with_key,
      TopicKind::WithKey,
      le = [0x02, 0x00, 0x00, 0x00],
      be = [0x00, 0x00, 0x00, 0x02]
  });
}