#[non_exhaustive]pub enum MovieError {
Show 16 variants
HeaderTruncated {
expected: usize,
got: usize,
},
BadMagic {
got: [u8; 8],
},
UnsupportedFormat {
got: u16,
max: u16,
},
FormatTooOld {
got: u16,
min: u16,
},
UnknownFlags(u8),
BadOptions(OptionsDecodeError),
RegionMismatch {
movie: Region,
host: Region,
},
BoardMismatch {
field: &'static str,
},
OptionNotApplicable(String),
StartStateTooOld {
got: u16,
min: u16,
},
UnsupportedFrameWidth {
got: u8,
max: u8,
},
BadRegion(u8),
Eof(usize),
BadSaveState(SnapshotError),
RomMismatch,
EpochMismatch {
movie: u32,
core: u32,
},
}Expand description
Errors produced by movie encode / decode / playback.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
HeaderTruncated
The blob is shorter than the fixed header.
BadMagic
The magic prefix is wrong.
UnsupportedFormat
The container format version is outside the range we understand.
FormatTooOld
v2.9.8 — the movie was written by an older release whose format does not record everything a faithful replay needs: before format 3 the emulation options, before 4 the full board, before 5 (v3.0.0) the emulation epoch. (Until v3.0.0 the message named only the options, which stopped being the whole story at format 4.)
UnknownFlags(u8)
v2.9.8 — the header flags carry a bit this build does not know.
BadOptions(OptionsDecodeError)
v2.9.8 — the OPTIONS block is malformed (an unknown enum byte, a bad Game Genie code, a truncated field).
RegionMismatch
v2.9.8 — the movie was recorded on another region (from a header that said PAL, say, where this one says NTSC). A region is built into the machine at load, so it cannot be applied; the movie is refused.
BoardMismatch
v2.9.8 — same ROM, different header: the cartridge the movie ran on had another mapper, submapper, mirroring, RAM size, battery or trainer. Since v2.9.8 the ROM identity excludes the header, so this is what tells a re-headered dump (or a changed database correction) apart.
OptionNotApplicable(String)
v2.9.8 — an option could not be applied to this machine (a Game Genie code that does not decode, in a hand-built movie).
StartStateTooOld
v2.9.8 — the movie’s embedded start-point save state predates the
.rns container epoch 3 (ADR 0042), which v2.9.8 refuses. Kept apart
from MovieError::BadSaveState so the message says what to do, in
the same words as MovieError::FormatTooOld.
Fields
UnsupportedFrameWidth
The header declared more bytes-per-frame than this build understands.
BadRegion(u8)
The region byte is not a value this build understands.
Eof(usize)
The body (start point and/or input stream) ran past EOF.
BadSaveState(SnapshotError)
The embedded start-point save state failed to apply.
RomMismatch
The running ROM’s hash does not match the movie’s recorded hash.
EpochMismatch
v3.0.0 (ADR 0045) — the movie was recorded by a version of RustyNES
that emulates differently: its EMULATION_EPOCH
is not this build’s. Replaying it would run the recorded inputs on
different timing, so it is refused rather than allowed to diverge.
Trait Implementations§
Source§impl Debug for MovieError
impl Debug for MovieError
Source§impl Display for MovieError
impl Display for MovieError
Source§impl Error for MovieError
impl Error for MovieError
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()