pub enum OpenError {
Io(Error),
TooShort,
BadMagic,
UnsupportedVersion(u8),
UnknownEngineKind(u8),
CorruptOffsets,
Sha256Mismatch,
}Expand description
Lookup error kind. Public so callers can distinguish “file is a different IDFv version” from “file is corrupt” — actionable difference: a v2 file should drive a tool upgrade prompt; a corrupt file should drive a rebuild.
Variants§
Io(Error)
I/O failure while reading the file. Wraps the source.
TooShort
File is too short to hold even the header region.
BadMagic
First 4 bytes are not b"IDFv". File is not an IDF dict at all.
UnsupportedVersion(u8)
format_version byte is not 1. A future v2 reader will accept
these; v1 reader returns this so the caller can prompt a rebuild
against the older tool.
UnknownEngineKind(u8)
engine_kind byte is outside the known set (per
EngineKind::from_byte).
CorruptOffsets
Header section offsets disagree with the file size — points past EOF or overlap. Indicates a truncated or rewritten file.
Sha256Mismatch
sha256_of_payload in the header does not match a fresh hash of the post-header bytes. Indicates the file was tampered with or corrupted between build and load.