Enum lofty::ItemKey

source ·
#[non_exhaustive]
pub enum ItemKey {
Show 103 variants AlbumTitle, SetSubtitle, ShowName, ContentGroup, TrackTitle, TrackSubtitle, OriginalAlbumTitle, OriginalArtist, OriginalLyricist, AlbumTitleSortOrder, AlbumArtistSortOrder, TrackTitleSortOrder, TrackArtistSortOrder, ShowNameSortOrder, ComposerSortOrder, AlbumArtist, TrackArtist, Arranger, Writer, Composer, Conductor, Director, Engineer, InvolvedPeople, Lyricist, MixDj, MixEngineer, MusicianCredits, Performer, Producer, Publisher, Label, InternetRadioStationName, InternetRadioStationOwner, Remixer, DiscNumber, DiscTotal, TrackNumber, TrackTotal, Popularimeter, ParentalAdvisory, RecordingDate, Year, OriginalReleaseDate, Isrc, Barcode, CatalogNumber, Work, Movement, MovementNumber, MovementTotal, MusicBrainzRecordingId, MusicBrainzTrackId, MusicBrainzReleaseId, MusicBrainzReleaseGroupId, MusicBrainzArtistId, MusicBrainzReleaseArtistId, MusicBrainzWorkId, FlagCompilation, FlagPodcast, FileType, FileOwner, TaggingTime, Length, OriginalFileName, OriginalMediaType, EncodedBy, EncoderSoftware, EncoderSettings, EncodingTime, ReplayGainAlbumGain, ReplayGainAlbumPeak, ReplayGainTrackGain, ReplayGainTrackPeak, AudioFileUrl, AudioSourceUrl, CommercialInformationUrl, CopyrightUrl, TrackArtistUrl, RadioStationUrl, PaymentUrl, PublisherUrl, Genre, InitialKey, Color, Mood, Bpm, CopyrightMessage, License, PodcastDescription, PodcastSeriesCategory, PodcastURL, PodcastReleaseDate, PodcastGlobalUniqueID, PodcastKeywords, Comment, Description, Language, Script, Lyrics, AppleXid, AppleId3v2ContentGroup, Unknown(String),
}
Expand description

A generic representation of a tag’s key

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

AlbumTitle

§

SetSubtitle

§

ShowName

§

ContentGroup

§

TrackTitle

§

TrackSubtitle

§

OriginalAlbumTitle

§

OriginalArtist

§

OriginalLyricist

§

AlbumTitleSortOrder

§

AlbumArtistSortOrder

§

TrackTitleSortOrder

§

TrackArtistSortOrder

§

ShowNameSortOrder

§

ComposerSortOrder

§

AlbumArtist

§

TrackArtist

§

Arranger

§

Writer

§

Composer

§

Conductor

§

Director

§

Engineer

§

InvolvedPeople

§

Lyricist

§

MixDj

§

MixEngineer

§

MusicianCredits

§

Performer

§

Producer

§

Publisher

§

Label

§

InternetRadioStationName

§

InternetRadioStationOwner

§

Remixer

§

DiscNumber

§

DiscTotal

§

TrackNumber

§

TrackTotal

§

Popularimeter

§

ParentalAdvisory

§

RecordingDate

§

Year

§

OriginalReleaseDate

§

Isrc

§

Barcode

§

CatalogNumber

§

Work

§

Movement

§

MovementNumber

§

MovementTotal

§

MusicBrainzRecordingId

§

MusicBrainzTrackId

§

MusicBrainzReleaseId

§

MusicBrainzReleaseGroupId

§

MusicBrainzArtistId

§

MusicBrainzReleaseArtistId

§

MusicBrainzWorkId

§

FlagCompilation

§

FlagPodcast

§

FileType

§

FileOwner

§

TaggingTime

§

Length

§

OriginalFileName

§

OriginalMediaType

§

EncodedBy

§

EncoderSoftware

§

EncoderSettings

§

EncodingTime

§

ReplayGainAlbumGain

§

ReplayGainAlbumPeak

§

ReplayGainTrackGain

§

ReplayGainTrackPeak

§

AudioFileUrl

§

AudioSourceUrl

§

CommercialInformationUrl

§

CopyrightUrl

§

TrackArtistUrl

§

RadioStationUrl

§

PaymentUrl

§

PublisherUrl

§

Genre

§

InitialKey

§

Color

§

Mood

§

Bpm

§

CopyrightMessage

§

License

§

PodcastDescription

§

PodcastSeriesCategory

§

PodcastURL

§

PodcastReleaseDate

§

PodcastGlobalUniqueID

§

PodcastKeywords

§

Comment

§

Description

§

Language

§

Script

§

Lyrics

§

AppleXid

§

AppleId3v2ContentGroup

§

Unknown(String)

When a key couldn’t be mapped to another variant

This will not allow writing keys that are out of spec (Eg. ID3v2.4 frame IDs must be 4 characters)

Implementations§

source§

impl ItemKey

source

pub fn from_key(tag_type: TagType, key: &str) -> Self

Map a format specific key to an ItemKey

NOTE: If used with ID3v2, this will only check against the ID3v2.4 keys. If you wish to use a V2 or V3 key, see upgrade_v2 and upgrade_v3

source

pub fn map_key(&self, tag_type: TagType, allow_unknown: bool) -> Option<&str>

Maps the variant to a format-specific key

Use allow_unknown to include ItemKey::Unknown. It is up to the caller to determine if the unknown key actually fits the format’s specifications.

Trait Implementations§

source§

impl Clone for ItemKey

source§

fn clone(&self) -> ItemKey

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for ItemKey

source§

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

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

impl Hash for ItemKey

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

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

impl PartialEq<ItemKey> for ItemKey

source§

fn eq(&self, other: &ItemKey) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<'a> TryFrom<&'a ItemKey> for AtomIdent<'a>

§

type Error = LoftyError

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

fn try_from(value: &'a ItemKey) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl<'a> TryFrom<&'a ItemKey> for FrameId<'a>

§

type Error = LoftyError

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

fn try_from(value: &'a ItemKey) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl TryFrom<ItemKey> for AtomIdent<'static>

§

type Error = LoftyError

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

fn try_from(value: ItemKey) -> Result<Self, Self::Error>

Performs the conversion.
source§

impl Eq for ItemKey

source§

impl StructuralEq for ItemKey

source§

impl StructuralPartialEq for ItemKey

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

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

§

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 Twhere U: TryFrom<T>,

§

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.