rtps_parser/rtps/
discovery_types.rs1#[derive(PartialEq, Eq, Debug, Clone, Copy)]
5pub struct BuiltinEndpointSet(pub u32);
6
7impl Default for BuiltinEndpointSet {
8 fn default() -> Self {
9 Self(
10 Self::BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER
11 | Self::BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR
12 | Self::BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER
13 | Self::BUILTIN_ENDPOINT_PUBLICATIONS_DETECTOR
14 | Self::BUILTIN_ENDPOINT_SUBSCRIPTIONS_ANNOUNCER
15 | Self::BUILTIN_ENDPOINT_SUBSCRIPTIONS_DETECTOR
16 | Self::BUILTIN_ENDPOINT_TOPICS_ANNOUNCER
17 | Self::BUILTIN_ENDPOINT_TOPICS_DETECTOR,
18 )
19 }
20}
21
22impl BuiltinEndpointSet {
23 pub const BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER: u32 = 1 << 0;
24 pub const BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR: u32 = 1 << 1;
25 pub const BUILTIN_ENDPOINT_PUBLICATIONS_ANNOUNCER: u32 = 1 << 2;
26 pub const BUILTIN_ENDPOINT_PUBLICATIONS_DETECTOR: u32 = 1 << 3;
27 pub const BUILTIN_ENDPOINT_SUBSCRIPTIONS_ANNOUNCER: u32 = 1 << 4;
28 pub const BUILTIN_ENDPOINT_SUBSCRIPTIONS_DETECTOR: u32 = 1 << 5;
29
30 pub const _BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER: u32 = 1 << 10;
43 pub const _BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER: u32 = 1 << 11;
44
45 pub const BUILTIN_ENDPOINT_TOPICS_ANNOUNCER: u32 = 1 << 28;
53 pub const BUILTIN_ENDPOINT_TOPICS_DETECTOR: u32 = 1 << 29;
54
55 #[allow(dead_code)]
56 pub fn new(value: u32) -> Self {
57 Self(value)
58 }
59
60 pub fn has(&self, endpoint: u32) -> bool {
61 (self.0 & endpoint) == endpoint
62 }
63}
64
65#[derive(PartialEq, Eq, Debug, Default, Clone, Copy)]
66pub struct BuiltinEndpointQos(pub u32);
67
68impl BuiltinEndpointQos {
69 #[allow(dead_code)]
70 pub const BEST_EFFORT_PARTICIPANT_MESSAGE_DATA_READER: u32 = 1 << 29;
71
72 #[allow(dead_code)]
73 pub fn new(value: u32) -> Self {
74 Self(value)
75 }
76
77 #[allow(dead_code)]
78 pub fn has(&self, endpoint: u32) -> bool {
79 (self.0 & endpoint) == endpoint
80 }
81}