pub enum ErrorKind {
Invalid(&'static str),
Malformed(&'static str),
}Expand description
The type of error that occurred while parsing.
As a library consumer, detailed errors about what specific part of the MIDI spec was violated are not very useful. For this reason, errors are broadly categorized into 2 classes, and specific error info is provided as a non-normative string literal.
Variants§
Invalid(&'static str)
Fatal errors while reading the file. It is likely that the file is not a MIDI file or is severely corrupted.
This error cannot be ignored, as there is not enough data to continue parsing. No information about the file could be rescued.
Malformed(&'static str)
Non-fatal error, but the file is clearly corrupted.
This kind of error is not emitted by default, only if the strict crate feature is
enabled.
Ignoring these errors (if the strict feature is disabled) can cause whole tracks to be
dropped.
Implementations§
Trait Implementations§
impl Copy for ErrorKind
Auto Trait Implementations§
impl Freeze for ErrorKind
impl RefUnwindSafe for ErrorKind
impl Send for ErrorKind
impl Sync for ErrorKind
impl Unpin for ErrorKind
impl UnwindSafe for ErrorKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more