[−][src]Struct metaflac::block::VorbisComment
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]
fn clone(&self) -> VorbisComment
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Eq for VorbisComment
[src]
impl PartialEq<VorbisComment> for VorbisComment
[src]
fn eq(&self, other: &VorbisComment) -> bool
[src]
fn ne(&self, other: &VorbisComment) -> bool
[src]
impl Debug for VorbisComment
[src]
Auto Trait Implementations
impl Send for VorbisComment
impl Sync for VorbisComment
impl Unpin for VorbisComment
impl UnwindSafe for VorbisComment
impl RefUnwindSafe for VorbisComment
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,