#[repr(u16)]pub enum RepresentationIdentifier {
CdrBE = 0,
CdrLE = 1,
PlCdrBE = 2,
PlCdrLE = 3,
Xcdr2BE = 6,
Xcdr2LE = 7,
DCdr2BE = 8,
DCdr2LE = 9,
PlXcdr2BE = 10,
PlXcdr2LE = 11,
}Expand description
CDR Representation Identifier (2 bytes)
Per RTPS v2.5 Section 10.5, Table 10.3 and DDS X-Types 1.3 Section 7.6.2.1.2
The representation identifier specifies the encoding format and byte order used for the serialized data payload.
§Supported Encodings
Only plain CDR v1 is supported by this implementation:
All other encodings (Parameter List, XCDR v2) will fail during serialization/deserialization.
Variants§
CdrBE = 0
CDR Big Endian (v1) - [0x00, 0x00] ✓ Supported
CdrLE = 1
CDR Little Endian (v1) - [0x00, 0x01] ✓ Supported
PlCdrBE = 2
Parameter List CDR Big Endian - [0x00, 0x02] ✗ Not supported
PlCdrLE = 3
Parameter List CDR Little Endian - [0x00, 0x03] ✗ Not supported
Xcdr2BE = 6
XCDR v2 Big Endian (X-Types 1.3) - [0x00, 0x06] ✗ Not supported
Xcdr2LE = 7
XCDR v2 Little Endian (X-Types 1.3) - [0x00, 0x07] ✗ Not supported
DCdr2BE = 8
Delimited CDR v2 Big Endian - [0x00, 0x08] ✗ Not supported
DCdr2LE = 9
Delimited CDR v2 Little Endian - [0x00, 0x09] ✗ Not supported
PlXcdr2BE = 10
Parameter List XCDR v2 Big Endian - [0x00, 0x0a] ✗ Not supported
PlXcdr2LE = 11
Parameter List XCDR v2 Little Endian - [0x00, 0x0b] ✗ Not supported
Implementations§
Source§impl RepresentationIdentifier
impl RepresentationIdentifier
Sourcepub const fn is_little_endian(&self) -> bool
pub const fn is_little_endian(&self) -> bool
Returns true if this representation uses little-endian byte order
Sourcepub const fn is_big_endian(&self) -> bool
pub const fn is_big_endian(&self) -> bool
Returns true if this representation uses big-endian byte order
Sourcepub const fn is_plain_cdr(&self) -> bool
pub const fn is_plain_cdr(&self) -> bool
Returns true if this is a plain CDR v1 encoding (CdrBE or CdrLE)
Only plain CDR v1 encodings are supported by this implementation.
Sourcepub const fn is_supported(&self) -> bool
pub const fn is_supported(&self) -> bool
Returns true if this encoding is supported by the current implementation
Currently only plain CDR v1 (CdrBE, CdrLE) is supported. Parameter List and XCDR v2 encodings are not supported.
Sourcepub const fn is_cdr_v1(&self) -> bool
pub const fn is_cdr_v1(&self) -> bool
Returns true if this is a CDR v1 encoding (including Parameter List CDR)
Sourcepub const fn is_parameter_list(&self) -> bool
pub const fn is_parameter_list(&self) -> bool
Returns true if this is a Parameter List encoding
Sourcepub fn from_bytes(bytes: [u8; 2]) -> Result<Self>
pub fn from_bytes(bytes: [u8; 2]) -> Result<Self>
Parse from raw bytes
Trait Implementations§
Source§impl Clone for RepresentationIdentifier
impl Clone for RepresentationIdentifier
Source§fn clone(&self) -> RepresentationIdentifier
fn clone(&self) -> RepresentationIdentifier
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more