#[non_exhaustive]pub enum IrError {
Show 43 variants
BufferTooShort {
expected: usize,
actual: usize,
},
BadSignature([u8; 8]),
LegacyModule {
version: u16,
},
UnsupportedWriter {
writer: [u16; 3],
reader: [u16; 3],
},
LengthMismatch {
declared: usize,
actual: usize,
},
ChecksumMismatch {
expected: u32,
computed: u32,
},
ReservedBits {
field: &'static str,
},
DuplicateSection(u16),
SectionsDoNotTile,
MissingSection(u16),
UnknownRequiredSection {
id: u16,
writer: [u16; 3],
},
LimitExceeded(Box<LimitViolation>),
TrailingBytes {
section: u16,
},
InvalidSchema(&'static str),
InvalidKeyPath(&'static str),
InvalidSourcePosition(&'static str),
InvalidDefault(u16),
SectionOutOfBounds {
section: usize,
offset: u32,
size: u32,
file_len: usize,
},
InvalidOpcode(u8),
InvalidSlotType(u8),
InvalidIslandTrigger(u8),
InvalidSlotSource(u8),
StringIndexOutOfBounds {
index: u32,
len: usize,
},
InvalidUtf8(String),
ListDepthExceeded {
max: u8,
},
IslandNotFound(u16),
JsonParseError(String),
InvalidSection,
RecursionLimitExceeded,
OutputLimitExceeded {
limit: usize,
},
InvalidIslandState(Box<IslandStateViolation>),
IslandStateLimitExceeded {
limit: usize,
},
InvalidListKey(Box<ListKeyViolation>),
ListBudgetExceeded {
max: usize,
},
InvalidName(String),
DuplicateSlotId(u16),
DuplicateIslandId(u16),
IslandOffsetMismatch {
island_id: u16,
byte_offset: u32,
},
UnknownSlotId(u16),
MalformedControlFlow {
pos: usize,
},
UnknownIslandId(u16),
NestedIslandRoot {
outer: u16,
inner: u16,
},
Panicked {
message: String,
},
}Expand description
Parser errors and their authoritative code() method.
Errors that can occur when parsing FMIR binary data.
Marked #[non_exhaustive]: new failure modes are added as the parser is
hardened, and downstream crates must not break when that happens. Match
with a _ => arm (or just use Display).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferTooShort
Input buffer is too short to contain the expected structure.
BadSignature([u8; 8])
Signature is not the FMIR v3 signature.
LegacyModule
A legacy FMIR header needs a rebuild.
UnsupportedWriter
Writer base version differs from the reader’s Cargo version.
LengthMismatch
Declared body length differs from the actual file.
ChecksumMismatch
CRC-32 does not match the file excluding its CRC field.
ReservedBits
Reserved bits must be zero.
DuplicateSection(u16)
Section ids must be strictly ascending and unique.
SectionsDoNotTile
Section offsets must cover exactly the data after the table.
MissingSection(u16)
A required section was absent.
UnknownRequiredSection
An unknown section was marked required.
LimitExceeded(Box<LimitViolation>)
An input-controlled size or count exceeds its ceiling.
TrailingBytes
Known sections must consume their complete payload.
InvalidSchema(&'static str)
Invalid props schema type or reference.
InvalidKeyPath(&'static str)
Invalid key-path entry.
InvalidSourcePosition(&'static str)
Invalid source-position entry.
InvalidDefault(u16)
A slot default does not parse for its declared type.
SectionOutOfBounds
A section extends beyond the file boundary.
Fields
InvalidOpcode(u8)
An opcode byte does not map to a known opcode.
InvalidSlotType(u8)
A slot-type byte does not map to a known slot type.
InvalidIslandTrigger(u8)
An island-trigger byte does not map to a known trigger.
InvalidSlotSource(u8)
A slot-source byte does not map to a known source.
StringIndexOutOfBounds
A string index is out of bounds.
Fields
InvalidUtf8(String)
A byte sequence is not valid UTF-8.
ListDepthExceeded
Nested LIST depth exceeded the maximum allowed.
IslandNotFound(u16)
An island with the given id was not found in the island table.
JsonParseError(String)
Failed to parse JSON input.
InvalidSection
A section descriptor has invalid values (e.g. integer overflow).
Also returned for opcode-stream offsets that overflow or point outside the region they were read from (branch/body lengths in SHOW_IF, SWITCH, LIST and TRY_START/FALLBACK).
RecursionLimitExceeded
Recursive opcode nesting (SHOW_IF, LIST, SWITCH, etc.) exceeded the maximum allowed depth.
OutputLimitExceeded
The rendered HTML exceeded the walker’s configured output budget.
InvalidIslandState(Box<IslandStateViolation>)
An executed island’s declared request state cannot be projected.
IslandStateLimitExceeded
The complete escaped state envelope exceeds its fixed byte ceiling.
InvalidListKey(Box<ListKeyViolation>)
RENDER-503: a keyed list row has no usable identity, repeats another row’s key, or did not render one root element to carry it (FORMA-181). No partial page is returned.
ListBudgetExceeded
Total LIST item iterations exceeded the walker’s per-render budget.
Distinct from IrError::ListDepthExceeded, which bounds nesting.
InvalidName(String)
A tag or attribute name from the string table is not a legal HTML name.
DuplicateSlotId(u16)
The slot table declares the same slot_id more than once.
DuplicateIslandId(u16)
The island table declares the same island id more than once.
IslandOffsetMismatch
An island’s byte_offset does not point at an ISLAND_START opcode
carrying that island’s own id.
Fields
UnknownSlotId(u16)
A slot id referenced by an island entry or an opcode is not declared in the slot table.
MalformedControlFlow
The opcode stream’s control-flow regions do not tile exactly: a branch/body length does not line up with the opcodes it contains.
UnknownIslandId(u16)
An ISLAND_START opcode names an island id the island table does not
declare. Such an island emits its <!--f:iN--> markers but no
data-forma-* attributes, so the client can never hydrate it.
NestedIslandRoot
Two ISLAND_START opcodes are pending on the same element: the outer
island’s body opens no tag of its own before the inner island starts,
so only one of them can carry the data-forma-island attribute set and
the other would silently never hydrate.
Fields
Panicked
The walk panicked, and crate::walker::walk_to_html_counted caught
the unwind. This reports a defect in the walker, not in the module or
the data. Under panic = "abort" there is nothing to catch and the
process ends instead.
Implementations§
Trait Implementations§
impl Eq for IrError
Source§impl Error for IrError
impl Error for IrError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()