Struct ape::Tag

source ·
pub struct Tag(_);
Expand description

An APE Tag containing APE Tag Items.

Examples

Creating a tag

use ape::{Item, Tag, write_to_path};

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

Updating a tag

use ape::{Item, read_from_path, write_to_path};

let path = "path/to/file";
let mut tag = read_from_path(path).unwrap();
let item = Item::from_text("album", "Album Name").unwrap();
tag.set_item(item);
tag.remove_items("cover");
write_to_path(&tag, path).unwrap();

Implementations§

Creates a new empty tag.

Returns a first found item by key.

Returns all items by key.

Sets a new item.

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

Adds a new item.

Unlike set_item, existing items with the same key are not removed.

Removes all items by key.

Returns a number of deleted items

Returns an iterator over the tag

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
The type of the elements being iterated over.
Which kind of iterator are we turning this into?
Creates an iterator from a value. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.