Skip to main content

Module encode

Module encode 

Source
Expand description

CdrEncode / CdrDecode traits + primitive implementations (W1.3).

Trait-based instead of free functions, so that composite types in W2/W3 can recursively encode their children uniformly without large type switches.

§Alignment convention

  • u8/i8/bool: 1
  • u16/i16: 2
  • u32/i32/f32/char: 4
  • u64/i64/f64: 8

Char is encoded as XCDR2 wchar32 (4 bytes) (OMG XTypes §7.4.7); that covers full Unicode. The XCDR1 char variant (1 byte ASCII) lives in the separate xcdr1 module (see the crate header).

Traits§

CdrDecode
Value can be decoded from a BufferReader.
CdrEncode
Value can be encoded into a BufferWriter.