Struct id3::Tag [] [src]

pub struct Tag { /* fields omitted */ }

An ID3 tag containing metadata frames.

Methods

impl<'a> Tag
[src]

Creates a new ID3v2.3 tag with no frames.

Creates a new ID3 tag with the specified version.

ID3v2 versions 2 to 4 are supported. Passing any other version will cause a panic.

Returns true if the reader might contain a valid ID3v1 tag.

Attempts to read an ID3v1 tag from the reader. Since the structure of ID3v1 is so different from ID3v2, the tag will be converted and stored internally as an ID3v2.3 tag.

Attempts to read an ID3v1 tag from the file at the specified path. The tag will be converted into an ID3v2.3 tag upon success.

Returns the version of the tag.

Example

use id3::Tag;

let tag = Tag::with_version(3);
assert_eq!(tag.version(), 3);Run

Sets the version of this tag.

ID3v2 versions 2 to 4 can be set. Trying to set any other version will cause a panic.

Any frames that could not be converted to the new version will be dropped.

Example

use id3::Tag;

let mut tag = Tag::with_version(4);
assert_eq!(tag.version(), 4);

tag.set_version(3);
assert_eq!(tag.version(), 3);Run

Returns the default unicode text encoding that should be used for this tag.

Example

use id3::Tag;
use id3::frame::Encoding::{UTF16, UTF8};

let mut tag_v3 = Tag::with_version(3);
assert_eq!(tag_v3.default_encoding(), UTF16);

let mut tag_v4 = Tag::with_version(4);
assert_eq!(tag_v4.default_encoding(), UTF8);Run

Returns a vector of references to all frames in the tag.

Example

use id3::{Tag, Frame};

let mut tag = Tag::new();

tag.push(Frame::new("TPE1"));
tag.push(Frame::new("APIC"));

assert_eq!(tag.frames().len(), 2);Run

Returns a reference to the first frame with the specified identifier.

Example

use id3::{Tag, Frame};

let mut tag = Tag::new();

tag.push(Frame::new("TIT2"));

assert!(tag.get("TIT2").is_some());
assert!(tag.get("TCON").is_none());Run

Returns a vector of references to frames with the specified identifier.

Example

use id3::{Tag, Frame};

let mut tag = Tag::new();

tag.push(Frame::new("TXXX"));
tag.push(Frame::new("TXXX"));
tag.push(Frame::new("TALB"));

assert_eq!(tag.get_all("TXXX").len(), 2);
assert_eq!(tag.get_all("TALB").len(), 1);Run

Adds the frame to the tag. The frame identifier will attempt to be converted into the corresponding identifier for the tag version.

Returns whether the frame was added to the tag. The only reason the frame would not be added to the tag is if the frame identifier could not be converted from the frame version to the tag version.

Example

use id3::{Tag, Frame};

let mut tag = Tag::new();
tag.push(Frame::new("TALB"));
assert_eq!(&tag.frames()[0].id[..], "TALB");Run

Adds a text frame using the default text encoding.

Example

use id3::Tag;

let mut tag = Tag::new();
tag.add_text_frame("TCON", "Metal");
assert_eq!(&tag.get("TCON").unwrap().content.text()[..], "Metal");Run

Adds a text frame using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.add_text_frame_enc("TRCK", "1/13", UTF16);
assert_eq!(&tag.get("TRCK").unwrap().content.text()[..], "1/13");Run

Removes the frame with the specified uuid.

Example

use id3::{Tag, Frame};

let mut tag = Tag::new();

tag.push(Frame::new("TPE2"));
assert_eq!(tag.frames().len(), 1);

let uuid = tag.frames()[0].uuid.clone();
tag.remove_uuid(&uuid[..]);
assert_eq!(tag.frames().len(), 0);Run

Removes all frames with the specified identifier.

Example

use id3::{Tag, Frame};

let mut tag = Tag::new();

tag.push(Frame::new("TXXX"));
tag.push(Frame::new("TXXX"));
tag.push(Frame::new("USLT"));

assert_eq!(tag.frames().len(), 3);

tag.remove("TXXX");
assert_eq!(tag.frames().len(), 1);

tag.remove("USLT");
assert_eq!(tag.frames().len(), 0);Run

Returns a vector of the extended text (TXXX) key/value pairs.

Example

use id3::{Tag, Frame};
use id3::frame::{self, Content};

let mut tag = Tag::new();

let mut frame = Frame::new("TXXX");
frame.content = Content::ExtendedText(frame::ExtendedText { 
    key: "key1".to_owned(),
    value: "value1".to_owned()
});
tag.push(frame);

let mut frame = Frame::new("TXXX");
frame.content = Content::ExtendedText(frame::ExtendedText { 
    key: "key2".to_owned(),
    value: "value2".to_owned()
}); 
tag.push(frame);

assert_eq!(tag.txxx().len(), 2);
assert!(tag.txxx().contains(&("key1", "value1")));
assert!(tag.txxx().contains(&("key2", "value2")));Run

Adds a user defined text frame (TXXX).

Example

use id3::Tag;

let mut tag = Tag::new();

tag.add_txxx("key1", "value1");
tag.add_txxx("key2", "value2");

assert_eq!(tag.txxx().len(), 2);
assert!(tag.txxx().contains(&("key1", "value1")));
assert!(tag.txxx().contains(&("key2", "value2")));Run

Adds a user defined text frame (TXXX) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();

tag.add_txxx_enc("key1", "value1", UTF16);
tag.add_txxx_enc("key2", "value2", UTF16);

assert_eq!(tag.txxx().len(), 2);
assert!(tag.txxx().contains(&("key1", "value1")));
assert!(tag.txxx().contains(&("key2", "value2")));Run

Removes the user defined text frame (TXXX) with the specified key and value.

A key or value may be None to specify a wildcard value.

Example

use id3::Tag;

let mut tag = Tag::new();

tag.add_txxx("key1", "value1");
tag.add_txxx("key2", "value2");
tag.add_txxx("key3", "value2");
tag.add_txxx("key4", "value3");
tag.add_txxx("key5", "value4");
assert_eq!(tag.txxx().len(), 5);

tag.remove_txxx(Some("key1"), None);
assert_eq!(tag.txxx().len(), 4);

tag.remove_txxx(None, Some("value2"));
assert_eq!(tag.txxx().len(), 2);

tag.remove_txxx(Some("key4"), Some("value3"));
assert_eq!(tag.txxx().len(), 1);

tag.remove_txxx(None, None);
assert_eq!(tag.txxx().len(), 0);Run

Returns a vector of references to the pictures in the tag.

Example

use id3::{Tag, Frame};
use id3::frame::{Content, Picture};

let mut tag = Tag::new();
 
let mut frame = Frame::new("APIC");
frame.content = Content::Picture(Picture::new());
tag.push(frame);

let mut frame = Frame::new("APIC");
frame.content = Content::Picture(Picture::new());
tag.push(frame);

assert_eq!(tag.pictures().len(), 2);Run

Adds a picture frame (APIC). Any other pictures with the same type will be removed from the tag.

Example

use id3::Tag;
use id3::frame::PictureType::Other;

let mut tag = Tag::new();
tag.add_picture("image/jpeg", Other, vec!());
tag.add_picture("image/png", Other, vec!());
assert_eq!(tag.pictures().len(), 1);
assert_eq!(&tag.pictures()[0].mime_type[..], "image/png");Run

Adds a picture frame (APIC) using the specified text encoding. Any other pictures with the same type will be removed from the tag.

Example

use id3::Tag;
use id3::frame::PictureType::Other;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.add_picture_enc("image/jpeg", Other, "", vec!(), UTF16);
tag.add_picture_enc("image/png", Other, "", vec!(), UTF16);
assert_eq!(tag.pictures().len(), 1);
assert_eq!(&tag.pictures()[0].mime_type[..], "image/png");Run

Removes all pictures of the specified type.

Example

use id3::Tag;
use id3::frame::PictureType::{CoverFront, Other};

let mut tag = Tag::new();
tag.add_picture("image/jpeg", CoverFront, vec!());
tag.add_picture("image/png", Other, vec!());
assert_eq!(tag.pictures().len(), 2);

tag.remove_picture_type(CoverFront);
assert_eq!(tag.pictures().len(), 1);
assert_eq!(tag.pictures()[0].picture_type, Other);Run

Returns a vector of comment (COMM) key/value pairs.

Example

use id3::{Tag, Frame};
use id3::frame::{Content, Comment};

let mut tag = Tag::new();

let mut frame = Frame::new("COMM");
frame.content = Content::Comment(Comment {
    lang: "eng".to_owned(),
    description: "key1".to_owned(),
    text: "value1".to_owned()
});
tag.push(frame);

let mut frame = Frame::new("COMM");
frame.content = Content::Comment(Comment { 
    lang: "eng".to_owned(),
    description: "key2".to_owned(),
    text: "value2".to_owned()
});
tag.push(frame);

assert_eq!(tag.comments().len(), 2);
assert!(tag.comments().contains(&("key1", "value1")));
assert!(tag.comments().contains(&("key2", "value2")));Run

Adds a comment (COMM).

Example

use id3::Tag;

let mut tag = Tag::new();

tag.add_comment("key1", "value1");
tag.add_comment("key2", "value2");

assert_eq!(tag.comments().len(), 2);
assert!(tag.comments().contains(&("key1", "value1")));
assert!(tag.comments().contains(&("key2", "value2")));Run

Adds a comment (COMM) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();

tag.add_comment_enc("eng", "key1", "value1", UTF16);
tag.add_comment_enc("eng", "key2", "value2", UTF16);

assert_eq!(tag.comments().len(), 2);
assert!(tag.comments().contains(&("key1", "value1")));
assert!(tag.comments().contains(&("key2", "value2")));Run

Removes the comment (COMM) with the specified key and value.

A key or value may be None to specify a wildcard value.

Example

use id3::Tag;

let mut tag = Tag::new();

tag.add_comment("key1", "value1");
tag.add_comment("key2", "value2");
tag.add_comment("key3", "value2");
tag.add_comment("key4", "value3");
tag.add_comment("key5", "value4");
assert_eq!(tag.comments().len(), 5);

tag.remove_comment(Some("key1"), None);
assert_eq!(tag.comments().len(), 4);

tag.remove_comment(None, Some("value2"));
assert_eq!(tag.comments().len(), 2);

tag.remove_comment(Some("key4"), Some("value3"));
assert_eq!(tag.comments().len(), 1);

tag.remove_comment(None, None);
assert_eq!(tag.comments().len(), 0);Run

Returns the year (TYER). Returns None if the year frame could not be found or if it could not be parsed.

Example

use id3::{Tag, Frame};
use id3::frame::Content;

let mut tag = Tag::new();
assert!(tag.year().is_none());

let mut frame_valid = Frame::new("TYER");
frame_valid.content = Content::Text("2014".to_owned());
tag.push(frame_valid);
assert_eq!(tag.year().unwrap(), 2014);

tag.remove("TYER");

let mut frame_invalid = Frame::new("TYER");
frame_invalid.content = Content::Text("nope".to_owned());
tag.push(frame_invalid);
assert!(tag.year().is_none());Run

Sets the year (TYER).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_year(2014);
assert_eq!(tag.year().unwrap(), 2014);Run

Sets the year (TYER) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_year_enc(2014, UTF16);
assert_eq!(tag.year().unwrap(), 2014);Run

Return the content of the TRDC frame, if any

Example

use id3::Tag;
use id3::Timestamp;

let mut tag = Tag::new();
tag.set_date_recorded(Timestamp{ year: Some(2014), month: None, day: None, hour: None, minute: None, second: None });
assert_eq!(tag.date_recorded().unwrap().year, Some(2014));Run

Sets the content of the TDRC frame

Example

use id3::Tag;
use id3::Timestamp;

let mut tag = Tag::new();
tag.set_date_recorded(Timestamp{ year: Some(2014), month: None, day: None, hour: None, minute: None, second: None });
assert_eq!(tag.date_recorded().unwrap().year, Some(2014));Run

Return the content of the TDRL frame, if any

Example

use id3::Tag;
use id3::Timestamp;

let mut tag = Tag::new();
tag.set_date_released(Timestamp{ year: Some(2014), month: None, day: None, hour: None, minute: None, second: None });
assert_eq!(tag.date_released().unwrap().year, Some(2014));Run

Sets the content of the TDRL frame

Example

use id3::Tag;
use id3::Timestamp;

let mut tag = Tag::new();
tag.set_date_released(Timestamp{ year: Some(2014), month: None, day: None, hour: None, minute: None, second: None });
assert_eq!(tag.date_released().unwrap().year, Some(2014));Run

Returns the artist (TPE1).

Example

use id3::{Frame, Tag};
use id3::frame::Content;

let mut tag = Tag::new();

let mut frame = Frame::new("TPE1");
frame.content = Content::Text("artist".to_owned());
tag.push(frame);
assert_eq!(tag.artist().unwrap(), "artist");Run

Sets the artist (TPE1).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_artist("artist");
assert_eq!(tag.artist().unwrap(), "artist");Run

Sets the artist (TPE1) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_artist_enc("artist", UTF16);
assert_eq!(tag.artist().unwrap(), "artist");Run

Removes the artist (TPE1).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_artist("artist");
assert!(tag.artist().is_some());

tag.remove_artist();
assert!(tag.artist().is_none());Run

Sets the album artist (TPE2).

Example

use id3::{Frame, Tag};
use id3::frame::Content;

let mut tag = Tag::new();

let mut frame = Frame::new("TPE2");
frame.content = Content::Text("artist".to_owned());
tag.push(frame);
assert_eq!(tag.album_artist().unwrap(), "artist");Run

Sets the album artist (TPE2).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_album_artist("artist");
assert_eq!(tag.album_artist().unwrap(), "artist");Run

Sets the album artist (TPE2) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_album_artist_enc("album artist", UTF16);
assert_eq!(tag.album_artist().unwrap(), "album artist");Run

Removes the album artist (TPE2).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_album_artist("artist");
assert!(tag.album_artist().is_some());

tag.remove_album_artist();
assert!(tag.album_artist().is_none());Run

Returns the album (TALB).

Example

use id3::{Frame, Tag};
use id3::frame::Content;

let mut tag = Tag::new();

let mut frame = Frame::new("TALB");
frame.content = Content::Text("album".to_owned());
tag.push(frame);
assert_eq!(tag.album().unwrap(), "album");Run

Sets the album (TALB).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_album("album");
assert_eq!(tag.album().unwrap(), "album");Run

Sets the album (TALB) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_album_enc("album", UTF16);
assert_eq!(tag.album().unwrap(), "album");Run

Removes the album (TALB).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_album("album");
assert!(tag.album().is_some());

tag.remove_album();
assert!(tag.album().is_none());Run

Returns the title (TIT2).

Example

use id3::{Frame, Tag};
use id3::frame::Content;

let mut tag = Tag::new();

let mut frame = Frame::new("TIT2");
frame.content = Content::Text("title".to_owned());
tag.push(frame);
assert_eq!(tag.title().unwrap(), "title");Run

Sets the title (TIT2).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_title("title");
assert_eq!(tag.title().unwrap(), "title");Run

Sets the song title (TIT2) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_title_enc("title", UTF16);
assert_eq!(tag.title().unwrap(), "title");Run

Removes the title (TIT2).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_title("title");
assert!(tag.title().is_some());

tag.remove_title();
assert!(tag.title().is_none());Run

Returns the duration (TLEN).

Example

use id3::{Frame, Tag};
use id3::frame::Content;

let mut tag = Tag::new();

let mut frame = Frame::new("TLEN");
frame.content = Content::Text("350".to_owned());
tag.push(frame);
assert_eq!(tag.duration().unwrap(), 350);Run

Sets the duration (TLEN).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_duration(350);
assert_eq!(tag.duration().unwrap(), 350);Run

Removes the duration (TLEN).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_duration(350);
assert!(tag.duration().is_some());

tag.remove_duration();
assert!(tag.duration().is_none());Run

Returns the genre (TCON).

Example

use id3::{Frame, Tag};
use id3::frame::Content;

let mut tag = Tag::new();

let mut frame = Frame::new("TCON");
frame.content = Content::Text("genre".to_owned());
tag.push(frame);
assert_eq!(tag.genre().unwrap(), "genre");Run

Sets the genre (TCON).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_genre("genre");
assert_eq!(tag.genre().unwrap(), "genre");Run

Sets the genre (TCON) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_genre_enc("genre", UTF16);
assert_eq!(tag.genre().unwrap(), "genre");Run

Removes the genre (TCON).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_genre("genre");
assert!(tag.genre().is_some());

tag.remove_genre();
assert!(tag.genre().is_none());Run

Returns the disc number (TPOS).

Example

use id3::{Tag, Frame};
use id3::frame::Content;

let mut tag = Tag::new();
assert!(tag.disc().is_none());

let mut frame_valid = Frame::new("TPOS");
frame_valid.content = Content::Text("4".to_owned());
tag.push(frame_valid);
assert_eq!(tag.disc().unwrap(), 4);

tag.remove("TPOS");

let mut frame_invalid = Frame::new("TPOS");
frame_invalid.content = Content::Text("nope".to_owned());
tag.push(frame_invalid);
assert!(tag.disc().is_none());Run

Sets the disc (TPOS).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_disc(2);
assert_eq!(tag.disc().unwrap(), 2);Run

Sets the disc number (TPOS) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_disc_enc(2, UTF16);
assert_eq!(tag.disc().unwrap(), 2);Run

Removes the disc number (TPOS).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_disc(3);
assert!(tag.disc().is_some());

tag.remove_disc();
assert!(tag.disc().is_none());Run

Returns the total number of discs (TPOS).

Example

use id3::{Tag, Frame};
use id3::frame::Content;

let mut tag = Tag::new();
assert!(tag.disc().is_none());

let mut frame_valid = Frame::new("TPOS");
frame_valid.content = Content::Text("4/10".to_owned());
tag.push(frame_valid);
assert_eq!(tag.total_discs().unwrap(), 10);

tag.remove("TPOS");

let mut frame_invalid = Frame::new("TPOS");
frame_invalid.content = Content::Text("4/nope".to_owned());
tag.push(frame_invalid);
assert!(tag.total_discs().is_none());Run

Sets the total number of discs (TPOS).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_total_discs(10);
assert_eq!(tag.total_discs().unwrap(), 10);Run

Sets the total number of discs (TPOS) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_total_discs_enc(12, UTF16);
assert_eq!(tag.total_discs().unwrap(), 12);Run

Removes the total number of discs (TPOS).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_total_discs(10);
assert!(tag.total_discs().is_some());

tag.remove_total_discs();
assert!(tag.total_discs().is_none());Run

Returns the track number (TRCK).

Example

use id3::{Tag, Frame};
use id3::frame::Content;

let mut tag = Tag::new();
assert!(tag.track().is_none());

let mut frame_valid = Frame::new("TRCK");
frame_valid.content = Content::Text("4".to_owned());
tag.push(frame_valid);
assert_eq!(tag.track().unwrap(), 4);

tag.remove("TRCK");

let mut frame_invalid = Frame::new("TRCK");
frame_invalid.content = Content::Text("nope".to_owned());
tag.push(frame_invalid);
assert!(tag.track().is_none());Run

Sets the track (TRCK).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_track(10);
assert_eq!(tag.track().unwrap(), 10);Run

Sets the track number (TRCK) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_track_enc(5, UTF16);
assert_eq!(tag.track().unwrap(), 5);Run

Removes the track number (TRCK).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_track(10);
assert!(tag.track().is_some());

tag.remove_track();
assert!(tag.track().is_none());Run

Returns the total number of tracks (TRCK).

Example

use id3::{Tag, Frame};
use id3::frame::Content;

let mut tag = Tag::new();
assert!(tag.total_tracks().is_none());

let mut frame_valid = Frame::new("TRCK");
frame_valid.content = Content::Text("4/10".to_owned());
tag.push(frame_valid);
assert_eq!(tag.total_tracks().unwrap(), 10);

tag.remove("TRCK");

let mut frame_invalid = Frame::new("TRCK");
frame_invalid.content = Content::Text("4/nope".to_owned());
tag.push(frame_invalid);
assert!(tag.total_tracks().is_none());Run

Sets the total number of tracks (TRCK).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_total_tracks(10);
assert_eq!(tag.total_tracks().unwrap(), 10);Run

Sets the total number of tracks (TRCK) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_total_tracks_enc(12, UTF16);
assert_eq!(tag.total_tracks().unwrap(), 12);Run

Removes the total number of tracks (TCON).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_total_tracks(10);
assert!(tag.total_tracks().is_some());

tag.remove_total_tracks();
assert!(tag.total_tracks().is_none());Run

Returns the lyrics (USLT).

Example

use id3::{Frame, Tag};
use id3::frame::Content;
use id3::frame::Lyrics;

let mut tag = Tag::new();

let mut frame = Frame::new("USLT");
frame.content = Content::Lyrics(Lyrics {
    lang: "eng".to_owned(),
    description: "description".to_owned(),
    text: "lyrics".to_owned()
});
tag.push(frame);
assert_eq!(tag.lyrics().unwrap(), "lyrics");Run

Sets the lyrics (USLT).

Example

use id3::Tag;

let mut tag = Tag::new();
tag.set_lyrics("lyrics");
assert_eq!(tag.lyrics().unwrap(), "lyrics");Run

Sets the lyrics text (USLT) using the specified text encoding.

Example

use id3::Tag;
use id3::frame::Encoding::UTF16;

let mut tag = Tag::new();
tag.set_lyrics_enc("eng", "description", "lyrics", UTF16);
assert_eq!(tag.lyrics().unwrap(), "lyrics");Run

Removes the lyrics text (USLT) from the tag.

Exmaple

use id3::Tag;
 
let mut tag = Tag::new();
tag.set_lyrics("lyrics");
assert!(tag.lyrics().is_some());
tag.remove_lyrics();
assert!(tag.lyrics().is_none());Run

Returns the contents of the reader without any ID3 metadata.

Will return true if the reader is a candidate for an ID3 tag. The reader position will be reset back to the previous position before returning.

Attempts to read an ID3 tag from the reader.

Attempts to write the ID3 tag to the writer.

Attempts to read an ID3 tag from the file at the indicated path.

Attempts to write the ID3 tag from the file at the indicated path. If the specified path is the same path which the tag was read from, then the tag will be written to the padding if possible.

Attempts to save the tag back to the file which it was read from. An error with kind InvalidInput will be returned if this is called on a tag which was not read from a file.