#[non_exhaustive]pub enum SaveStateError {
Truncated {
expected: usize,
available: usize,
},
UnexpectedTag {
expected: [u8; 4],
found: [u8; 4],
},
BadMagic,
UnsupportedVersion {
found: u16,
max: u16,
},
Invalid(String),
}Expand description
Errors from decoding a save-state.
docs/adr/0006’s “reject loudly on an unrecognized/corrupt format, never silently truncate
or zero-fill” honesty posture — the same posture docs/adr/0003 already applies to
coprocessor accuracy.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated
The buffer ended before the expected number of bytes were available.
Fields
UnexpectedTag
A section’s declared tag didn’t match what the caller expected at this point in the format — either genuine corruption, or a format version whose section order changed.
Fields
BadMagic
The blob’s leading magic bytes didn’t match — not a RustySNES save-state at all.
UnsupportedVersion
The blob’s format-version major number is newer than this build understands.
Fields
Invalid(String)
A component rejected the decoded bytes as semantically invalid (e.g. an enum discriminant with no matching variant) even though the section framing itself was well-formed.
Trait Implementations§
Source§impl Debug for SaveStateError
impl Debug for SaveStateError
Source§impl Display for SaveStateError
impl Display for SaveStateError
Source§impl Error for SaveStateError
impl Error for SaveStateError
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()