#[non_exhaustive]pub enum NefError {
Show 18 variants
TooShort,
InvalidMagic {
expected: [u8; 4],
actual: [u8; 4],
},
ChecksumMismatch {
expected: u32,
calculated: u32,
},
TrailingData {
extra: usize,
},
InvalidCompiler,
ReservedByteNonZero {
offset: usize,
value: u8,
},
ReservedWordNonZero {
offset: usize,
value: u16,
},
UnexpectedEof {
offset: usize,
},
InvalidMethodToken {
index: usize,
},
IntegerOverflow {
offset: usize,
},
InvalidUtf8String {
offset: usize,
},
EmptyScript,
SourceTooLong {
length: usize,
max: usize,
},
TooManyMethodTokens {
count: usize,
max: usize,
},
ScriptTooLarge {
length: usize,
max: usize,
},
MethodNameInvalid {
name: String,
},
CallFlagsInvalid {
flags: u8,
allowed: u8,
},
FileTooLarge {
size: u64,
max: u64,
},
}Expand description
Errors returned while parsing NEF containers.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
TooShort
File too short to contain a NEF header and checksum.
InvalidMagic
Magic bytes at the start of the file did not match the NEF format.
ChecksumMismatch
Checksum mismatch between the stored and calculated values.
Fields
TrailingData
Trailing bytes were present after the checksum.
InvalidCompiler
The compiler field contained invalid UTF-8.
ReservedByteNonZero
Reserved byte fields must be zero according to the NEF spec.
ReservedWordNonZero
Reserved word fields must be zero according to the NEF spec.
UnexpectedEof
Input ended unexpectedly while parsing.
InvalidMethodToken
A method token entry was malformed.
IntegerOverflow
A variable-length integer exceeded the supported range.
InvalidUtf8String
A variable-length string contained invalid UTF-8.
EmptyScript
Script section cannot be empty.
SourceTooLong
Source string exceeded the maximum supported length.
TooManyMethodTokens
Method token count exceeded the maximum supported value.
ScriptTooLarge
Script section exceeded the maximum supported size.
MethodNameInvalid
Method token name contained disallowed characters.
CallFlagsInvalid
Call flags contained bits outside the allowed set.
FileTooLarge
Input file exceeded the maximum supported size.