Skip to main content

Module binary

Module binary 

Source
Expand description

Binary serialization infrastructure for NanoTDF

This module provides traits and utilities for reading and writing binary data in the NanoTDF format. All multi-byte integers use big-endian byte order as specified in the NanoTDF specification.

Re-exports§

pub use traits::BinaryRead;
pub use traits::BinaryWrite;

Modules§

traits
Traits for binary serialization and deserialization

Functions§

read_bytes
Read exactly n bytes from a reader
read_u8
Read a u8 from a reader
read_u16_be
Read a u16 (big-endian) from a reader
read_u24_be
Read a u24 (big-endian, 3 bytes) from a reader Returns as u32 since Rust doesn’t have a u24 type
read_u32_be
Read a u32 (big-endian) from a reader
write_bytes
Write bytes to a writer
write_u8
Write a u8 to a writer
write_u16_be
Write a u16 (big-endian) to a writer
write_u24_be
Write a u24 (big-endian, 3 bytes) to a writer Takes u32 but only writes the lower 24 bits
write_u32_be
Write a u32 (big-endian) to a writer