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.
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
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 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 · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more