#[non_exhaustive]pub enum AprFormatError {
ChecksumMismatch {
expected: u32,
actual: u32,
},
FormatError {
message: String,
},
Serialization(String),
ValidationError {
message: String,
},
Io(Error),
InvalidOffset,
HeaderTooLarge,
UnsupportedVersion {
found: (u8, u8),
supported: (u8, u8),
},
}Expand description
Errors produced while reading or writing the .apr container format.
#[non_exhaustive] so new variants can be added without a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ChecksumMismatch
CRC32 integrity check failed: the stored trailer does not match the recomputed checksum of the file body.
Fields
FormatError
Invalid or corrupt container structure (bad magic, truncated header, unknown model type, out-of-range sizes, …).
Serialization(String)
Serialization / deserialization failure (bincode, msgpack, JSON).
ValidationError
Poka-yoke / Jidoka validation failure (e.g. refusing to save a model whose quality gate scored zero).
Io(Error)
Underlying I/O failure (file open / read / write).
InvalidOffset
A computed offset fell outside the file/data boundary.
HeaderTooLarge
The declared header / metadata section exceeds the permitted maximum (compression-bomb / overflow protection).
UnsupportedVersion
The on-disk format version is newer than this reader supports.
Trait Implementations§
Source§impl Debug for AprFormatError
impl Debug for AprFormatError
Source§impl Display for AprFormatError
impl Display for AprFormatError
Source§impl Error for AprFormatError
impl Error for AprFormatError
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()