#[non_exhaustive]pub enum OpllStateError {
Truncated(usize),
UnsupportedVersion(u8),
ChipTypeMismatch {
got: u8,
want: u8,
},
InvalidEgState(u8),
}Expand description
Errors returned by Opll::restore.
Deliberately its own type rather than ApuSnapshotError: the OPLL blob does
not ride in the APU section of a save state. It rides in the mapper
section of whichever board carries the chip (VRC7 today), which is versioned
independently of APU_SNAPSHOT_VERSION. Sharing an error type would imply a
coupling between two schemas that must be free to move apart.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Truncated(usize)
Blob is shorter than the schema declares.
UnsupportedVersion(u8)
The blob’s version byte is not understood by this build.
ChipTypeMismatch
The blob was written by a differently-configured chip (YM2413 state restored into a VRC7 instance, or the reverse). The patch ROM differs between them, so the slot patches would be reinterpreted against the wrong instrument set.
InvalidEgState(u8)
An envelope-generator state tag outside the six defined variants.
Trait Implementations§
Source§impl Debug for OpllStateError
impl Debug for OpllStateError
Source§impl Display for OpllStateError
impl Display for OpllStateError
Source§impl Error for OpllStateError
impl Error for OpllStateError
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()