#[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 code user, 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
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).
Link(String)
A value containing the parsed contents of a web link frame.
ExtendedLink(ExtendedLink)
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 as_raw instead of matching on this variant. See the compatibility note in the top level enum docs.
Implementations
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 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 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
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
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
Auto Trait Implementations
impl RefUnwindSafe for Content
impl UnwindSafe for Content
Blanket Implementations
Mutably borrows from an owned value. Read more