Enum ErrorKind

Source
#[non_exhaustive]
pub enum ErrorKind {
Show 21 variants UnknownFormat, TooMuchData, SizeMismatch, FileDecoding(FileDecodingError), FileEncoding(FileEncodingError), NotAPicture, UnsupportedPicture, UnsupportedTag, FakeTag, TextDecode(&'static str), BadTimestamp(&'static str), Id3v2(Id3v2Error), BadAtom(&'static str), AtomMismatch, OggPage(PageError), StringFromUtf8(FromUtf8Error), StrFromUtf8(Utf8Error), Io(Error), Fmt(Error), Alloc(TryReserveError), Infallible(Infallible),
}
Expand description

The types of errors that can occur

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.
§

UnknownFormat

Unable to guess the format

§

TooMuchData

Attempting to read/write an abnormally large amount of data

§

SizeMismatch

Expected the data to be a different size than provided

This occurs when the size of an item is written as one value, but that size is either too big or small to be valid within the bounds of that item.

§

FileDecoding(FileDecodingError)

Errors that occur while decoding a file

§

FileEncoding(FileEncodingError)

Errors that occur while encoding a file

§

NotAPicture

Provided an invalid picture

§

UnsupportedPicture

Attempted to write a picture that the format does not support

§

UnsupportedTag

Arises when writing a tag to a file type that doesn’t support it

§

FakeTag

Arises when a tag is expected (Ex. found an “ID3 “ chunk in a WAV file), but isn’t found

§

TextDecode(&'static str)

Errors that arise while decoding text

§

BadTimestamp(&'static str)

Arises when decoding OR encoding a problematic Timestamp

§

Id3v2(Id3v2Error)

Errors that arise while reading/writing ID3v2 tags

§

BadAtom(&'static str)

Arises when an atom contains invalid data

§

AtomMismatch

Arises when attempting to use Atom::merge with mismatching identifiers

§

OggPage(PageError)

Errors that arise while parsing OGG pages

§

StringFromUtf8(FromUtf8Error)

Unable to convert bytes to a String

§

StrFromUtf8(Utf8Error)

Unable to convert bytes to a str

§

Io(Error)

Represents all cases of std::io::Error.

§

Fmt(Error)

Represents all cases of std::fmt::Error.

§

Alloc(TryReserveError)

Failure to allocate enough memory

§

Infallible(Infallible)

This should never be encountered

Trait Implementations§

Source§

impl Debug for ErrorKind

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.