Expand description
BIF archive support. BIF binary reader and writer.
BIF (BIFF) files are archive containers referenced by KEY indexes.
Each entry stores only (resource_id, type_id, payload); names/resrefs are
resolved through KEY metadata.
§Shape of the container
A fixed 20-byte header, a variable resource table located by
variable_table_offset, an optional fixed resource table directly after it,
and the payload addressed per entry.
Nothing here carries a name. An entry knows its id, type, offset and size;
the resref lives in the KEY, which reaches in by position.
That is why a BIF cannot be read on its own.
The fixed table is a format feature nothing uses: fixed_count is zero in
all 26 archives of a vanilla install, and the engine ignores the scalar
anyway. The table is parsed when present so such a file round-trips.
Compressed .bzf archives are gated behind the crate feature bzf and read
through BifIndex, which takes the container kind
from the caller rather than guessing it from content – nothing inside a
compressed file distinguishes it.
Byte-level field maps for the header and both entry records, the compressed
variant and its LZMA payload framing, and the engine’s own load sequence
live in docs/src/formats/archives/bif.md.
Structs§
- Bif
- In-memory BIF archive.
- BifIndex
- A lazily-read BIF archive.
- BifIndex
Entry - One indexed resource: its identity and where its bytes live.
- BifRead
Options - BIF reader option set.
- BifResource
- One resource entry stored in a BIF archive.
Enums§
- BifBinary
Error - Errors produced while parsing or serializing BIF binary data.
- BifContainer
- BIF container kind.
- BifRead
Mode - BIF reader input policy.
- BifResource
Storage - Storage table kind for a
BifResource.
Functions§
- read_
bif - Reads a BIF archive from a reader.
- read_
bif_ from_ bytes - Reads a BIF archive from bytes.
- read_
bif_ from_ bytes_ with_ options - Reads a BIF archive from bytes with explicit options.
- read_
bif_ with_ options - Reads a BIF archive from a reader with explicit options.
- write_
bif - Writes a BIF archive to a writer.
- write_
bif_ to_ vec - Serializes a BIF archive to bytes.