#[non_exhaustive]
pub enum Content {
Show 13 variants Text(String), ExtendedText(ExtendedText), Link(String), ExtendedLink(ExtendedLink), Comment(Comment), Popularimeter(Popularimeter), Lyrics(Lyrics), SynchronisedLyrics(SynchronisedLyrics), Picture(Picture), EncapsulatedObject(EncapsulatedObject), Chapter(Chapter), MpegLocationLookupTable(MpegLocationLookupTable), Unknown(Unknown),
}
Expand description

The decoded contents of a Frame.

Compatibility

It is important to note that the ID3 spec has a variety of extensions of which not all are implemented by this library. When a new frame content type is added, the signature of this enum changes. Hence, the non_exhaustive attribute is set.

However, when a new frame type variant is added, frames that would previously decode to Unknown are now decoded to their new variants. This would break user code, such as custom decoders, that was expecting Unknown.

In order to prevent breakage when this library adds a new frame type, users must use the Content::to_unknown method which will return an Unknown regardlesss of whether the frame content was successfully decoded.

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.

Text(String)

A value containing the parsed contents of a text frame.

ExtendedText(ExtendedText)

A value containing the parsed contents of a user defined text frame (TXXX).

A value containing the parsed contents of a web link frame.

A value containing the parsed contents of a user defined web link frame (WXXX).

Comment(Comment)

A value containing the parsed contents of a comment frame (COMM).

Popularimeter(Popularimeter)

Popularimeter frame content (POPM).

Lyrics(Lyrics)

A value containing the parsed contents of a lyrics frame (USLT).

SynchronisedLyrics(SynchronisedLyrics)

A value containing the parsed contents of a synchronised lyrics frame (SYLT).

Picture(Picture)

A value containing the parsed contents of a picture frame (APIC).

EncapsulatedObject(EncapsulatedObject)

A value containing the parsed contents of a general encapsulated object frame (GEOB).

Chapter(Chapter)

A chapter object containing frames by itself (CHAP).

MpegLocationLookupTable(MpegLocationLookupTable)

MPEG location lookup table content (MLLT).

Unknown(Unknown)

A value containing the bytes of a currently unknown frame type.

Users that wish to write custom decoders must use Content::to_unknown instead of matching on this variant. See the compatibility note in the top level enum docs.

Implementations

Constructs a new Text Content from the specified set of strings.

Panics

If any of the strings contain a null byte.

Example
use id3::frame::Content;

let c = Content::new_text_values(["foo", "bar", "baz"]);
assert_eq!(c, Content::Text("foo\u{0}bar\u{0}baz".to_string()))

Returns the Text or None if the value is not Text.

Returns split values of the Text frame or None if the value is not Text. This is only useful for ID3v2.4 tags, which support text frames containing multiple values separated by null bytes. This method returns an iterator over the separated values.

Returns the ExtendedText or None if the value is not ExtendedText.

Returns the Link or None if the value is not Link.

Returns the ExtendedLink or None if the value is not ExtendedLink.

Returns the EncapsulatedObject or None if the value is not EncapsulatedObject.

Returns the Comment or None if the value is not Comment.

Returns the Lyrics or None if the value is not Lyrics.

Returns the SynchronisedLyrics or None if the value is not SynchronisedLyrics.

Returns the Picture or None if the value is not Picture.

Returns the Chapter or None if the value is not Chapter.

Returns the MpegLocationLookupTable or None if the value is not MpegLocationLookupTable.

👎 Deprecated:

Use to_unknown

Returns the Unknown or None if the value is not Unknown.

Returns the Unknown variant or an ad-hoc encoding of any other variant.

See the compatibility note on the docs of Content for the reason of why this function exists.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Formats the value using the given formatter. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.