#[non_exhaustive]pub enum SaveError {
InvalidMagic {
offset: usize,
found: u32,
},
DecompressionFailed {
offset: usize,
message: String,
},
UnexpectedEof {
offset: usize,
expected: usize,
},
ChunkTooLarge {
offset: usize,
declared: u32,
},
InvalidMetaLength {
length: usize,
},
MetaDecryptionFailed,
UnsupportedMetaFormat {
version: u32,
},
Sha256Mismatch {
expected: [u8; 32],
actual: [u8; 32],
},
MappingParseError {
message: String,
},
JsonParseError {
message: String,
},
Io(Error),
}Expand description
Error returned by save file decompression and parsing operations.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
InvalidMagic
Block header magic mismatch.
DecompressionFailed
LZ4 decompression failed for a block.
UnexpectedEof
File ended before the expected number of bytes could be read.
ChunkTooLarge
A block’s decompressed_size exceeds the maximum chunk size.
InvalidMetaLength
Metadata file has an invalid length (not one of the known sizes).
MetaDecryptionFailed
Metadata decryption failed – magic sentinel not found after trying all slots.
UnsupportedMetaFormat
Metadata format version is unsupported (e.g., 2000/vanilla).
Sha256Mismatch
SHA-256 verification failed.
MappingParseError
Failed to parse a mapping JSON file.
JsonParseError
Failed to parse save JSON.
Io(Error)
Wrapper for std::io::Error (file I/O).
Trait Implementations§
Source§impl Error for SaveError
impl Error for SaveError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for SaveError
impl !RefUnwindSafe for SaveError
impl Send for SaveError
impl Sync for SaveError
impl Unpin for SaveError
impl UnsafeUnpin for SaveError
impl !UnwindSafe for SaveError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more