pub enum IrError {
Show 16 variants
BufferTooShort {
expected: usize,
actual: usize,
},
BadMagic([u8; 4]),
UnsupportedVersion(u16),
SectionOutOfBounds {
section: usize,
offset: u32,
size: u32,
file_len: usize,
},
InvalidOpcode(u8),
InvalidSlotType(u8),
InvalidIslandTrigger(u8),
InvalidPropsMode(u8),
InvalidSlotSource(u8),
StringIndexOutOfBounds {
index: u32,
len: usize,
},
InvalidUtf8(String),
ListDepthExceeded {
max: u8,
},
IslandNotFound(u16),
JsonParseError(String),
InvalidSection,
RecursionLimitExceeded,
}Expand description
Errors that can occur when parsing FMIR binary data.
Variants§
BufferTooShort
Input buffer is too short to contain the expected structure.
BadMagic([u8; 4])
Magic bytes do not match “FMIR”.
UnsupportedVersion(u16)
IR version is not supported.
SectionOutOfBounds
A section extends beyond the file boundary.
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.
InvalidPropsMode(u8)
A props-mode byte does not map to a known mode.
InvalidSlotSource(u8)
A slot-source byte does not map to a known source.
StringIndexOutOfBounds
A string index is out of bounds.
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).
RecursionLimitExceeded
Recursive opcode nesting (SHOW_IF, LIST, SWITCH, etc.) exceeded the maximum allowed depth.
Trait Implementations§
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()