Skip to main content

Module bytes

Module bytes 

Source
Expand description

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

ReFS is a little-endian on-disk format (Windows/NT platform), so these mirror xfs-core’s big-endian helpers with LE decode. 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::RefsError::Truncated.

Functions§

ascii
Best-effort ASCII rendering of a byte slice — printable ASCII kept, every other byte shown as .. Used to render the offending value legibly in fail-loud “unrecognized signature” errors (show the unrecognized value).
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.