Struct ape::Tag [] [src]

pub struct Tag {
    pub items: Vec<Item>,
}

An APE Tag containing APE Tag Items.

Examples

Creating a tag

use ape::{Tag, Item};

let mut tag = Tag::new();
let item = Item::from_text("artist", "Artist Name").unwrap();
tag.set_item(item);
tag.write("path/to/file").unwrap();

Updating a tag

use ape::{read, Item};

let path = "path/to/file";
let mut tag = read(path).unwrap();
let item = Item::from_text("album", "Album Name").unwrap();
tag.set_item(item);
tag.remove_item("cover");
tag.write(path).unwrap();

Fields

A vector of items included in the tag.

Methods

impl Tag
[src]

Creates a new empty tag.

Returns an item by key.

Sets a new item.

If there is an item with the same key, it will be removed.

Removes an item by key.

Returns true, if item was removed, and false otherwise.

Attempts to write the APE Tag to the file at the specified path.

Errors

It is considered an error if there are no items in the tag.

Trait Implementations

impl Debug for Tag
[src]

Formats the value using the given formatter.