#[non_exhaustive]pub enum Reason {
Show 19 variants
Truncated,
UnknownProlog(u32),
TooDeep,
SizeOverflow,
LengthTooShort(usize),
DoesNotFit {
kind: ObjectType,
size: usize,
left: usize,
},
DirectoryOffset,
RealTooShort,
NotBcd {
kind: ObjectType,
hex: String,
},
BadSign(u8),
EmptyInteger,
LengthTooSmall(ObjectType),
OddString,
UnitWithoutReal,
ArrayDimensions(usize),
ArrayLength,
TooManyObjects,
TooManyNibbles,
TooManyCloned,
}Expand description
Why the nibbles at DecodeError::offset are not an object.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
The object runs past the end of the nibbles: a field starts or ends beyond them.
UnknownProlog(u32)
The 5-nibble prolog is in the prolog range but is no known type.
TooDeep
Objects nest deeper than MAX_DEPTH levels.
SizeOverflow
A size or position does not fit a usize.
LengthTooShort(usize)
A length field holds less than its own 5 nibbles.
DoesNotFit
The object’s fields say it is size nibbles long, but only left
nibbles follow its start.
Fields
kind: ObjectTypeIts type.
DirectoryOffset
A directory’s last-variable offset matches none of its records.
RealTooShort
A real’s body is shorter than 16 nibbles.
NotBcd
A real’s or an integer’s body holds a nibble above 9; the body as hex.
Fields
kind: ObjectTypeThe type (ObjectType::Real or ObjectType::Integer).
BadSign(u8)
A real’s sign nibble is neither 0 nor 9.
EmptyInteger
An integer without a single nibble.
LengthTooSmall(ObjectType)
A string’s, binary integer’s or integer’s length field is below 5.
OddString
A string of an odd number of nibbles.
UnitWithoutReal
A unit object whose first element is no real.
ArrayDimensions(usize)
An array of more dimensions than the calculator makes (2).
ArrayLength
An array whose dimensions do not match its length.
TooManyObjects
More objects than crate::MAX_DECODED_OBJECTS in one decode.
TooManyNibbles
More nibbles read than crate::MAX_DECODED_NIBBLES in one decode.
TooManyCloned
More nibbles cloned than crate::MAX_CLONED_NIBBLES in one
decode.