pub struct ID3v1Tag {
pub title: Option<String>,
pub artist: Option<String>,
pub album: Option<String>,
pub year: Option<String>,
pub comment: Option<String>,
pub track_number: Option<u8>,
pub genre: Option<u8>,
}
Expand description
An ID3v1 tag
ID3v1 is a severely limited format, with each field being incredibly small in size. All fields have been commented with their maximum sizes and any other additional restrictions.
Attempting to write a field greater than the maximum size will not error, it will just be shrunk.
Supported file types
Conversions
From Tag
Two checks are performed when converting a genre:
Fields
title: Option<String>
Track title, 30 bytes max
artist: Option<String>
Track artist, 30 bytes max
album: Option<String>
Album title, 30 bytes max
year: Option<String>
Release year, 4 bytes max
comment: Option<String>
A short comment
The number of bytes differs between versions, but not much. A V1 tag may have been read, which limits this field to 30 bytes. A V1.1 tag, however, only has 28 bytes available.
Lofty will always write a V1.1 tag.
track_number: Option<u8>
The track number, 1 byte max
Issues:
- The track number cannot be 0. Many readers, including Lofty, look for a null byte at the end of the comment to differentiate between V1 and V1.1.
- A V1 tag may have been read, which does not have a track number.
genre: Option<u8>
The track’s genre, 1 byte max
ID3v1 has a predefined set of genres, see GENRES
.
This byte should be an index to a genre.
Trait Implementations
sourceimpl Accessor for ID3v1Tag
impl Accessor for ID3v1Tag
sourcefn remove_title(&mut self)
fn remove_title(&mut self)
Removes the title Read more
sourcefn set_artist(&mut self, value: String)
fn set_artist(&mut self, value: String)
Sets the artist Read more
sourcefn remove_artist(&mut self)
fn remove_artist(&mut self)
Removes the artist Read more
sourcefn remove_album(&mut self)
fn remove_album(&mut self)
Removes the album Read more
sourcefn remove_genre(&mut self)
fn remove_genre(&mut self)
Removes the genre Read more
sourcefn remove_track(&mut self)
fn remove_track(&mut self)
Removes the track Read more
sourcefn set_comment(&mut self, value: String)
fn set_comment(&mut self, value: String)
Sets the comment Read more
sourcefn remove_comment(&mut self)
fn remove_comment(&mut self)
Removes the comment Read more
sourcefn remove_year(&mut self)
fn remove_year(&mut self)
Removes the year Read more
sourcefn track_total(&self) -> Option<u32>
fn track_total(&self) -> Option<u32>
Returns the track total Read more
sourcefn set_track_total(&mut self, _value: u32)
fn set_track_total(&mut self, _value: u32)
Sets the track total Read more
sourcefn remove_track_total(&mut self)
fn remove_track_total(&mut self)
Removes the track total Read more
sourcefn remove_disk(&mut self)
fn remove_disk(&mut self)
Removes the disk Read more
sourcefn disk_total(&self) -> Option<u32>
fn disk_total(&self) -> Option<u32>
Returns the disk total Read more
sourcefn set_disk_total(&mut self, _value: u32)
fn set_disk_total(&mut self, _value: u32)
Sets the disk total Read more
sourcefn remove_disk_total(&mut self)
fn remove_disk_total(&mut self)
Removes the disk total Read more
sourceimpl TagExt for ID3v1Tag
impl TagExt for ID3v1Tag
type Err = LoftyError
type Err = LoftyError
The associated error which can be returned from IO operations
sourcefn save_to_path<P: AsRef<Path>>(&self, path: P) -> Result<(), Self::Err>
fn save_to_path<P: AsRef<Path>>(&self, path: P) -> Result<(), Self::Err>
Save the tag to a path Read more
impl Eq for ID3v1Tag
impl StructuralEq for ID3v1Tag
impl StructuralPartialEq for ID3v1Tag
Auto Trait Implementations
impl RefUnwindSafe for ID3v1Tag
impl Send for ID3v1Tag
impl Sync for ID3v1Tag
impl Unpin for ID3v1Tag
impl UnwindSafe for ID3v1Tag
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more