Module parsers

Source
Expand description

This file contains generic parsers to read data from a stream of bytes and interpret them as various types.

Functionsยง

parse_bool
Get a u8 from a vector of bytes and advance a position marker by 1
parse_f16
Get a f16 from a vector of bytes and advance a position marker by 2
parse_f32
Get a f32 from a vector of bytes and advance a position marker by 4
parse_f64
Get a f64 from a vector of bytes and advance a position marker by 8
parse_string
Get a string from a bytestream and advance a position marker
parse_u8
Get a u8 from a vector of bytes and advance a position marker by 1
parse_u16
Get a u16 from a vector of bytes and advance a position marker by 2
parse_u32
Get a u32 from a vector of bytes and advance a position marker by 4
parse_u64
Get a u64 from a vector of bytes and advance a position marker by 8
parse_u16_be
Get a u16 from a vector of bytes in big-endian and advance a position marker by 2
parse_u32_be
Get a u32 from a vector of bytes in big-endian and advance a position marker by 4
parse_u32_for_16bit_words
Get a u32 from a vector of bytes and advance a position marker by 4 for a non-standard representation of u32 (neither le or be, but shuffled)
parse_u48_for_16bit_words
Get a 48bit number from a vector of bytes
parse_u64_old_for_test
Get a u64 from a vector of bytes and advance a position marker by 8
parse_usizeDeprecated
u8_to_u16
Restore a vector of u16 from a vector of u8
u8_to_u16_14bit
This interpretes two following u8 as an u16 Useful for deserialization of waveforms. Additionally it masks the first 2 bits binary adding 0x3ff to each u16.
u8_to_u16_err_check
Restore a vector of u16 from a vector of u8, using the first 2 bits of each u16 to get channel/cell error bit information
u16_to_u8
The resulting vector has twice the number of entries of the original vector. This is useful, when serializing data represented as u16, e.g. the waveforms.