pub enum Tag {
Id3Tag {
inner: Tag,
},
VorbisFlacTag {
inner: Tag,
},
Mp4Tag {
inner: Tag,
},
OpusTag {
inner: Tag,
},
}Expand description
An object containing tags of one of the supported formats.
Variants§
Implementations§
source§impl Tag
impl Tag
sourcepub fn read_from_path<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn read_from_path<P: AsRef<Path>>(path: P) -> Result<Self>
Attempts to read a set of tags from the given path.
§Errors
This function could error if the given path has a file extension which contains invalid unicode or if the given path does not have a file extension at all.
This function could also error if the given path has a valid extension but the extension is not among the types supported by this crate.
Lastly, an error will be raised if the file type is supported but the reading the tags fails for some reason other than missing tags.
sourcepub fn write_to_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
pub fn write_to_path<P: AsRef<Path>>(&mut self, path: P) -> Result<()>
Attempts to write the tags to the indicated path.
§Errors
This function will error if writing the tags fails in any way.
sourcepub fn new_empty_id3() -> Self
pub fn new_empty_id3() -> Self
Creates an empty set of tags in the ID3 format.
sourcepub fn new_empty_flac() -> Self
pub fn new_empty_flac() -> Self
Creates an empty set of tags in the FLAC format.
sourcepub fn new_empty_mp4() -> Self
pub fn new_empty_mp4() -> Self
Creates an empty set of tags in the MP4 format.
source§impl Tag
impl Tag
sourcepub fn get_album_info(&self) -> Option<Album>
pub fn get_album_info(&self) -> Option<Album>
Gets the album information. If the album or album_artist fields are not present in the
audio file, this method returns None.
sourcepub fn set_album_info(&mut self, album: Album) -> Result<()>
pub fn set_album_info(&mut self, album: Album) -> Result<()>
Sets the album information of the audio track.
§Errors
This function will error if album.cover has an invalid or unsupported MIME type.
Supported MIME types are: image/bmp, image/jpeg, image/png
sourcepub fn remove_all_album_info(&mut self)
pub fn remove_all_album_info(&mut self)
Removes all album infofrom the audio track.
sourcepub fn remove_title(&mut self)
pub fn remove_title(&mut self)
Removes any title fields from the file.
sourcepub fn artist(&self) -> Option<String>
pub fn artist(&self) -> Option<String>
Gets the artist (note: NOT the album artist!)
If multiple ARTIST tags are present, they will be joined with a ;
sourcepub fn set_artist(&mut self, artist: &str)
pub fn set_artist(&mut self, artist: &str)
Sets the artist (note: NOT the album artist!)
sourcepub fn remove_artist(&mut self)
pub fn remove_artist(&mut self)
Removes the artist (note: NOT the album artist!)