Trait lofty::Accessor

source ·
pub trait Accessor {
Show 30 methods // Provided methods fn artist(&self) -> Option<Cow<'_, str>> { ... } fn set_artist(&mut self, _value: String) { ... } fn remove_artist(&mut self) { ... } fn title(&self) -> Option<Cow<'_, str>> { ... } fn set_title(&mut self, _value: String) { ... } fn remove_title(&mut self) { ... } fn album(&self) -> Option<Cow<'_, str>> { ... } fn set_album(&mut self, _value: String) { ... } fn remove_album(&mut self) { ... } fn genre(&self) -> Option<Cow<'_, str>> { ... } fn set_genre(&mut self, _value: String) { ... } fn remove_genre(&mut self) { ... } fn track(&self) -> Option<u32> { ... } fn set_track(&mut self, _value: u32) { ... } fn remove_track(&mut self) { ... } fn track_total(&self) -> Option<u32> { ... } fn set_track_total(&mut self, _value: u32) { ... } fn remove_track_total(&mut self) { ... } fn disk(&self) -> Option<u32> { ... } fn set_disk(&mut self, _value: u32) { ... } fn remove_disk(&mut self) { ... } fn disk_total(&self) -> Option<u32> { ... } fn set_disk_total(&mut self, _value: u32) { ... } fn remove_disk_total(&mut self) { ... } fn year(&self) -> Option<u32> { ... } fn set_year(&mut self, _value: u32) { ... } fn remove_year(&mut self) { ... } fn comment(&self) -> Option<Cow<'_, str>> { ... } fn set_comment(&mut self, _value: String) { ... } fn remove_comment(&mut self) { ... }
}
Expand description

Provides accessors for common items

This attempts to only provide methods for items that all tags have in common, but there may be exceptions.

Provided Methods§

source

fn artist(&self) -> Option<Cow<'_, str>>

Returns the artist

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.artist(), None);
source

fn set_artist(&mut self, _value: String)

Sets the artist

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_artist(value);

assert_eq!(tag.artist(), Some(value));
source

fn remove_artist(&mut self)

Removes the artist

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_artist(value);

assert_eq!(tag.artist(), Some(value));

tag.remove_artist();

assert_eq!(tag.artist(), None);
source

fn title(&self) -> Option<Cow<'_, str>>

Returns the title

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.title(), None);
source

fn set_title(&mut self, _value: String)

Sets the title

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_title(value);

assert_eq!(tag.title(), Some(value));
source

fn remove_title(&mut self)

Removes the title

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_title(value);

assert_eq!(tag.title(), Some(value));

tag.remove_title();

assert_eq!(tag.title(), None);
source

fn album(&self) -> Option<Cow<'_, str>>

Returns the album

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.album(), None);
source

fn set_album(&mut self, _value: String)

Sets the album

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_album(value);

assert_eq!(tag.album(), Some(value));
source

fn remove_album(&mut self)

Removes the album

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_album(value);

assert_eq!(tag.album(), Some(value));

tag.remove_album();

assert_eq!(tag.album(), None);
source

fn genre(&self) -> Option<Cow<'_, str>>

Returns the genre

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.genre(), None);
source

fn set_genre(&mut self, _value: String)

Sets the genre

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_genre(value);

assert_eq!(tag.genre(), Some(value));
source

fn remove_genre(&mut self)

Removes the genre

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_genre(value);

assert_eq!(tag.genre(), Some(value));

tag.remove_genre();

assert_eq!(tag.genre(), None);
source

fn track(&self) -> Option<u32>

Returns the track

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.track(), None);
source

fn set_track(&mut self, _value: u32)

Sets the track

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_track(value);

assert_eq!(tag.track(), Some(value));
source

fn remove_track(&mut self)

Removes the track

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_track(value);

assert_eq!(tag.track(), Some(value));

tag.remove_track();

assert_eq!(tag.track(), None);
source

fn track_total(&self) -> Option<u32>

Returns the track total

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.track_total(), None);
source

fn set_track_total(&mut self, _value: u32)

Sets the track total

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_track_total(value);

assert_eq!(tag.track_total(), Some(value));
source

fn remove_track_total(&mut self)

Removes the track total

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_track_total(value);

assert_eq!(tag.track_total(), Some(value));

tag.remove_track_total();

assert_eq!(tag.track_total(), None);
source

fn disk(&self) -> Option<u32>

Returns the disk

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.disk(), None);
source

fn set_disk(&mut self, _value: u32)

Sets the disk

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_disk(value);

assert_eq!(tag.disk(), Some(value));
source

fn remove_disk(&mut self)

Removes the disk

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_disk(value);

assert_eq!(tag.disk(), Some(value));

tag.remove_disk();

assert_eq!(tag.disk(), None);
source

fn disk_total(&self) -> Option<u32>

Returns the disk total

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.disk_total(), None);
source

fn set_disk_total(&mut self, _value: u32)

Sets the disk total

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_disk_total(value);

assert_eq!(tag.disk_total(), Some(value));
source

fn remove_disk_total(&mut self)

Removes the disk total

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_disk_total(value);

assert_eq!(tag.disk_total(), Some(value));

tag.remove_disk_total();

assert_eq!(tag.disk_total(), None);
source

fn year(&self) -> Option<u32>

Returns the year

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.year(), None);
source

fn set_year(&mut self, _value: u32)

Sets the year

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_year(value);

assert_eq!(tag.year(), Some(value));
source

fn remove_year(&mut self)

Removes the year

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_year(value);

assert_eq!(tag.year(), Some(value));

tag.remove_year();

assert_eq!(tag.year(), None);
source

fn comment(&self) -> Option<Cow<'_, str>>

Returns the comment

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);            ///
assert_eq!(tag.comment(), None);
source

fn set_comment(&mut self, _value: String)

Sets the comment

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_comment(value);

assert_eq!(tag.comment(), Some(value));
source

fn remove_comment(&mut self)

Removes the comment

Example
use lofty::{Tag, Accessor};

let mut tag = Tag::new(tag_type);
tag.set_comment(value);

assert_eq!(tag.comment(), Some(value));

tag.remove_comment();

assert_eq!(tag.comment(), None);

Implementors§