[][src]Crate id3

A library to read and write ID3v2 tags. ID3 versions v2.2, v2.3, and v2.4 are supported.

Modifying an existing tag

use id3::{Tag, Version};

let mut tag = Tag::read_from_path("music.mp3").unwrap();

// print the artist the hard way
println!("{}", tag.get("TPE1").unwrap().content().text().unwrap());

// or print it the easy way
println!("{}", tag.artist().unwrap());

tag.write_to_path("music.mp3", Version::Id3v24).unwrap();

Creating a new tag

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

let mut tag = Tag::new();

// set the album the hard way
let frame = Frame::with_content("TALB", Content::Text("album".to_string()));
tag.add_frame(frame);

// or set it the easy way
tag.set_album("album");

tag.write_to_path("music.mp3", Version::Id3v24).unwrap();

Resources

  • ID3v2.2 http://id3.org/id3v2-00
  • ID3v2.3 http://id3.org/id3v2.3.0
  • ID3v2.4 http://id3.org/id3v2.4.0-structure

Re-exports

pub use crate::frame::Frame;

Modules

frame

Contains types and methods for operating on ID3 frames.

v1

Utilities for working with ID3v1 tags.

Structs

Encoder

The Encoder may be used to encode tags.

EncoderBuilder

Builder for Encoder.

Error

A structure able to represent any error that may occur while performing metadata operations.

Tag

An ID3 tag containing metadata frames.

Timestamp

Represents a date and time according to the ID3v2.4 spec:

Enums

Content

The decoded contents of a frame.

ErrorKind

Kinds of errors that may occur while performing metadata operations.

Version

Denotes the version of a tag.

Type Definitions

Result

Type alias for the result of tag operations.