pub trait TagExt: Accessor + Into<Tag> + Sized {
type Err;
fn is_empty(&self) -> bool;
fn save_to_path<P: AsRef<Path>>(&self, path: P) -> Result<(), Self::Err>;
fn save_to(&self, file: &mut File) -> Result<(), Self::Err>;
fn dump_to<W: Write>(&self, writer: &mut W) -> Result<(), Self::Err>;
fn remove_from_path<P: AsRef<Path>>(&self, path: P) -> Result<(), Self::Err>;
fn remove_from(&self, file: &mut File) -> Result<(), Self::Err>;
fn clear(&mut self);
}
Expand description
A set of common methods between tags
This provides a set of methods to make interaction with all tags a similar experience.
This can be implemented downstream to provide a familiar interface for custom tags.
Required Associated Types
Required Methods
Whether the tag has any items
Example
use lofty::{Accessor, Tag, TagExt};
let mut tag = Tag::new(tag_type);
assert!(tag.is_empty());
tag.set_artist(String::from("Foo artist"));
assert!(!tag.is_empty());
Dump the tag to a writer
This will only write the tag, it will not produce a usable file.