Enum Id3v2ErrorKind

Source
#[non_exhaustive]
pub enum Id3v2ErrorKind {
Show 19 variants BadId3v2Version(u8, u8), V2Compression, BadExtendedHeaderSize, BadFrameId(Vec<u8>), UnsupportedFrameId(ItemKey), BadFrameLength, EmptyFrame(FrameId<'static>), MissingDataLengthIndicator, InvalidUnsynchronisation, V2InvalidTextEncoding, BadPictureFormat(String), BadSyncText, MissingUfidOwner, BadRva2ChannelType, BadTimestampFormat, Decompression(DecompressError), InvalidEncryptionMethodSymbol(u8), BadFrame(String, &'static str), InvalidLanguage([u8; 3]),
}
Expand description

The types of errors that can occur while interacting with ID3v2 tags

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

BadId3v2Version(u8, u8)

Arises when an invalid ID3v2 version is found

§

V2Compression

Arises when a compressed ID3v2.2 tag is encountered

At the time the ID3v2.2 specification was written, a compression scheme wasn’t decided. As such, it is recommended to ignore the tag entirely.

§

BadExtendedHeaderSize

Arises when an extended header has an invalid size (must be >= 6 bytes and less than the total tag size)

§

BadFrameId(Vec<u8>)

Arises when a frame ID contains invalid characters (must be within 'A'..'Z' or '0'..'9') or if the ID is too short/long.

§

UnsupportedFrameId(ItemKey)

Arises when no frame ID is available in the ID3v2 specification for an item key and the associated value type.

§

BadFrameLength

Arises when a frame doesn’t have enough data

§

EmptyFrame(FrameId<'static>)

Arises when a frame with no content is parsed with ParsingMode::Strict

§

MissingDataLengthIndicator

Arises when reading/writing a compressed or encrypted frame with no data length indicator

§

InvalidUnsynchronisation

Arises when a frame or tag has its unsynchronisation flag set, but the content is not actually synchsafe

See FrameFlags::unsynchronisation for an explanation.

§

V2InvalidTextEncoding

Arises when a text encoding other than Latin-1 or UTF-16 appear in an ID3v2.2 tag

§

BadPictureFormat(String)

Arises when an invalid picture format is parsed. Only applicable to ID3v2Version::V2

§

BadSyncText

Arises when invalid data is encountered while reading an ID3v2 synchronized text frame

§

MissingUfidOwner

Arises when decoding a UniqueFileIdentifierFrame with no owner

§

BadRva2ChannelType

Arises when decoding a RelativeVolumeAdjustmentFrame with an invalid channel type

§

BadTimestampFormat

Arises when decoding a TimestampFormat with an invalid type

§

Decompression(DecompressError)

Available on crate feature id3v2_compression_support only.

Arises when a compressed frame is unable to be decompressed

§

InvalidEncryptionMethodSymbol(u8)

Arises when attempting to write an encrypted frame with an invalid encryption method symbol (must be <= 0x80)

§

BadFrame(String, &'static str)

Arises when attempting to write an invalid Frame (Bad FrameId/FrameValue pairing)

§

InvalidLanguage([u8; 3])

Arises when attempting to write a CommentFrame or UnsynchronizedTextFrame with an invalid language

Trait Implementations§

Source§

impl Debug for Id3v2ErrorKind

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for Id3v2ErrorKind

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
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.