Function to_writer

Source
pub fn to_writer<T, BO, W>(writer: W, value: &T) -> Result<()>
where T: Serialize, BO: ByteOrder, W: Write,
Expand description

General CDR serialization for type T:Serialize

Takes ownership of the writer, but that can be a reference.

You need to specifiy the byte order (endianness) to use. In CDR, endianess cannot be detected from serialized stream, but has to be agreed out-of-band.