#[non_exhaustive]pub enum SnapshotError {
HeaderTruncated {
expected: usize,
got: usize,
},
BadMagic {
got: [u8; 8],
},
UnsupportedFormat {
got: u16,
max: u16,
},
SectionTruncated {
tag: String,
declared: usize,
got: usize,
},
VersionMismatch {
tag: String,
file_version: u8,
chip_supports: u8,
},
SectionInvalid {
tag: String,
reason: String,
},
MissingSection(String),
Eof(usize),
}Expand description
Errors produced by save-state encode / decode.
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.
HeaderTruncated
The blob is shorter than the header.
BadMagic
The magic prefix is wrong.
UnsupportedFormat
The container format version is outside the range we understand.
SectionTruncated
A section body is shorter than its declared length.
Fields
VersionMismatch
A section had a version this build does not handle.
Fields
SectionInvalid
A section’s body failed internal consistency checks.
MissingSection(String)
A required section was missing.
Eof(usize)
A section blob ran past EOF.
Implementations§
Source§impl SnapshotError
impl SnapshotError
Trait Implementations§
Source§impl Debug for SnapshotError
impl Debug for SnapshotError
Source§impl Display for SnapshotError
impl Display for SnapshotError
Source§impl Error for SnapshotError
impl Error for SnapshotError
1.30.0 · 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()
Source§impl From<SnapshotError> for MovieError
impl From<SnapshotError> for MovieError
Source§fn from(source: SnapshotError) -> Self
fn from(source: SnapshotError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for SnapshotError
impl RefUnwindSafe for SnapshotError
impl Send for SnapshotError
impl Sync for SnapshotError
impl Unpin for SnapshotError
impl UnsafeUnpin for SnapshotError
impl UnwindSafe for SnapshotError
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