pub enum SmfError {
Show 22 variants
InvalidHeader {
offset: usize,
},
UnexpectedEof {
offset: usize,
},
InvalidVlq {
offset: usize,
},
InvalidDivision {
offset: usize,
raw: u16,
},
LimitExceeded {
offset: usize,
kind: SmfLimitKind,
actual: usize,
maximum: usize,
},
AllocationFailed {
offset: usize,
requested: usize,
},
MalformedRunningStatus {
offset: usize,
},
UnsupportedStatus {
offset: usize,
status: u8,
},
InvalidChannelData {
offset: usize,
},
InvalidMetaLength {
offset: usize,
type_byte: u8,
expected: usize,
actual: usize,
},
MissingEndOfTrack {
offset: usize,
},
InvalidSystemEvent {
offset: usize,
status: u8,
},
FormatTrackMismatch,
IndependentPatternsCannotMerge,
TrackCountOutOfRange(usize),
TpqOutOfRange(u32),
InexactEventTime,
NegativeDelta,
DeltaOutOfRange(i64),
ChunkTooLarge(usize),
PayloadTooLarge(usize),
TimeOverflow {
offset: usize,
},
}Expand description
Errors raised while reading or writing a Standard MIDI File.
Variants§
InvalidHeader
The MThd/MTrk chunk header was malformed.
UnexpectedEof
The byte stream ended before the structure was complete.
InvalidVlq
A variable-length quantity was not terminated within four bytes.
InvalidDivision
The header carried an invalid metrical or SMPTE division.
LimitExceeded
A configured defensive read limit was exceeded.
Fields
kind: SmfLimitKindResource being bounded.
AllocationFailed
A bounded allocation failed even though its requested size was within the configured limits.
Fields
MalformedRunningStatus
A data byte appeared with no running status in effect.
UnsupportedStatus
A status byte that the reader does not handle was encountered.
InvalidChannelData
A channel message carried an out-of-range data byte.
InvalidMetaLength
A recognised meta event used a payload length forbidden by SMF.
Fields
MissingEndOfTrack
A track chunk ended without its required end-of-track meta event.
InvalidSystemEvent
A system message used an invalid status, length, or data byte.
Fields
FormatTrackMismatch
The header format and the track count are inconsistent (for example, format 0 with more than one track).
IndependentPatternsCannotMerge
Format 2 contains independent patterns and cannot be flattened onto a shared timeline without selecting a track.
TrackCountOutOfRange(usize)
The track count cannot be represented in the SMF header.
TpqOutOfRange(u32)
The ticks-per-quarter value cannot be represented as metrical SMF TPQ.
InexactEventTime
An event time could not be represented exactly at the file resolution.
NegativeDelta
Track events were not monotonic in absolute time, yielding a negative delta.
DeltaOutOfRange(i64)
A track delta cannot be represented as an SMF four-byte VLQ.
ChunkTooLarge(usize)
A track chunk body cannot be represented in the SMF chunk length field.
PayloadTooLarge(usize)
A meta or SysEx payload length cannot be represented as an SMF four-byte VLQ.
TimeOverflow
Absolute tick accumulation overflowed the in-memory event time.
Trait Implementations§
impl Eq for SmfError
Source§impl Error for SmfError
impl Error for SmfError
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()