A library for reading and writing ID3 metadata.
```rust use id3::{Tag, Version};
fn main() -> Result<(), Box
// Get a bunch of frames...
if let Some(artist) = tag.artist() {
println!("artist: {}", artist);
}
if let Some(title) = tag.title() {
println!("title: {}", title);
}
if let Some(album) = tag.album() {
println!("album: {}", album);
}
// Get frames before getting their content for more complex tags.
if let Some(artist) = tag.get("TPE1").and_then(|frame| frame.content().text()) {
println!("artist: {}", artist);
}
Ok(())
} ```
```rust use id3::{Tag, Version};
fn main() -> Result<(), Box
tag.write_to_path("music.mp3", Version::Id3v24)?;
Ok(())
} ```
```rust use id3::{Tag, Frame, Version}; use id3::frame::Content;
fn main() -> Result<(), Box
// Set the album the hard way.
tag.add_frame(Frame::with_content("TALB", Content::Text("album".to_string())));
tag.write_to_path("music.mp3", Version::Id3v24)?;
Ok(())
} ```