[][src]Struct metaflac::block::VorbisComment

pub struct VorbisComment {
    pub vendor_string: String,
    pub comments: HashMap<String, Vec<String>>,
}

A structure representing a VORBIS_COMMENT block.

Fields

vendor_string: String

The vendor string.

comments: HashMap<String, Vec<String>>

A map of keys to a list of their values.

Methods

impl VorbisComment[src]

pub fn new() -> VorbisComment[src]

Returns a new VorbisComment with an empty vendor string and no comments.

pub fn from_bytes(bytes: &[u8]) -> Result<VorbisComment>[src]

Attempts to parse the bytes as a vorbis comment block. Returns a VorbisComment on success.

pub fn to_bytes(&self) -> Vec<u8>[src]

Returns a vector representation of the vorbis comment suitable for writing to a file.

pub fn get(&self, key: &str) -> Option<&Vec<String>>[src]

Returns a reference to the vector of comments for the specified key.

pub fn set<K: Into<String>, V: Into<String>>(&mut self, key: K, values: Vec<V>)[src]

Sets the comments for the specified key. Any previous values under the key will be removed.

pub fn remove(&mut self, key: &str)[src]

Removes the comments for the specified key.

pub fn remove_pair(&mut self, key: &str, value: &str)[src]

Removes any matching key/value pairs.

pub fn artist(&self) -> Option<&Vec<String>>[src]

Returns a reference to the vector of values with the ARTIST key.

pub fn set_artist<T: Into<String>>(&mut self, artists: Vec<T>)[src]

Sets the values for the ARTIST key. This will result in any ARTISTSORT comment being removed.

pub fn remove_artist(&mut self)[src]

Removes all values with the ARTIST key. This will result in any ARTISTSORT comments being removed as well.

pub fn album(&self) -> Option<&Vec<String>>[src]

Returns a reference to the vector of values with the ALBUM key.

pub fn set_album<T: Into<String>>(&mut self, albums: Vec<T>)[src]

Sets the values for the ALBUM key. This will result in any ALBUMSORT comments being removed.

pub fn remove_album(&mut self)[src]

Removes all values with the ALBUM key. This will result in any ALBUMSORT comments being removed as well.

pub fn genre(&self) -> Option<&Vec<String>>[src]

Returns a reference to the vector of values with the GENRE key.

pub fn set_genre<T: Into<String>>(&mut self, genres: Vec<T>)[src]

Sets the values for the GENRE key.

pub fn remove_genre(&mut self)[src]

Removes all values with the GENRE key.

pub fn title(&self) -> Option<&Vec<String>>[src]

Returns reference to the vector of values with the TITLE key.

pub fn set_title<T: Into<String>>(&mut self, title: Vec<T>)[src]

Sets the values for the TITLE key. This will result in any TITLESORT comments being removed.

pub fn remove_title(&mut self)[src]

Removes all values with the TITLE key. This will result in any TITLESORT comments being removed as well.

pub fn track(&self) -> Option<u32>[src]

Attempts to convert the first TRACKNUMBER comment to a u32.

pub fn set_track(&mut self, track: u32)[src]

Sets the TRACKNUMBER comment.

pub fn remove_track(&mut self)[src]

Removes all values with the TRACKNUMBER key.

pub fn total_tracks(&self) -> Option<u32>[src]

Attempts to convert the first TOTALTRACKS comment to a u32.

pub fn set_total_tracks(&mut self, total_tracks: u32)[src]

Sets the TOTALTRACKS comment.

pub fn remove_total_tracks(&mut self)[src]

Removes all values with the TOTALTRACKS key.

pub fn album_artist(&self) -> Option<&Vec<String>>[src]

Returns a reference to the vector of values with the ALBUMARTIST key.

pub fn set_album_artist<T: Into<String>>(&mut self, album_artists: Vec<T>)[src]

Sets the values for the ALBUMARTIST key. This will result in any ALBUMARTISTSORT comments being removed.

pub fn remove_album_artist(&mut self)[src]

Removes all values with the ALBUMARTIST key. This will result in any ALBUMARTISTSORT comments being removed as well.

pub fn lyrics(&self) -> Option<&Vec<String>>[src]

Returns a reference to the vector of values with the LYRICS key.

pub fn set_lyrics<T: Into<String>>(&mut self, lyrics: Vec<T>)[src]

Sets the values for the LYRICS key.

pub fn remove_lyrics(&mut self)[src]

Removes all values with the LYRICS key.

Trait Implementations

impl Clone for VorbisComment[src]

impl Eq for VorbisComment[src]

impl PartialEq<VorbisComment> for VorbisComment[src]

impl Debug for VorbisComment[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]