Skip to main content

Module bytes

Module bytes 

Source
Expand description

Bounds-checked little-endian readers (the Paranoid Gatekeeper standard).

btrfs is little-endian on disk throughout. Every reader yields 0 when the requested range lies outside the buffer, so a malformed or truncated image can never panic a parser. Callers that need to distinguish “field absent” from “field is zero” bounds-check the buffer length up front and surface crate::BtrfsError::Truncated.

Functions§

le_u16
Read a little-endian u16 at off, or 0 if out of range.
le_u32
Read a little-endian u32 at off, or 0 if out of range.
le_u64
Read a little-endian u64 at off, or 0 if out of range.
u8_at
Read a single byte at off, or 0 if out of range.