Appearance
cellpack::format::cpk::parse_directory
Module contract · All interfaces
At a glance
pub fn parse_directory(
super_bytes: &[u8],
s: &Superblock,
dir: &[u8],
) -> Result<Vec<ChunkEntry>>Parses and checks the directory against its superblock: the hash, rows that tile 0..n_rows in order, and page-aligned, ascending, non-overlapping chunks after the superblock and before the directory.
super_bytes is the whole superblock and dir the directory bytes (at least s.directory_len()). Entries come back in row order, which is also file order. The checks are inter-field, so a directory never needs to be trusted beyond what the returned entries say.
Contract reference
See the module reference for semantic input/output rules, units, allocation, mutation, failure behavior, and lifetime requirements. Declarations and documented members are synchronized from the crate source.