Struct lofty::id3::v2::KeyValueFrame
source · pub struct KeyValueFrame<'a> {
pub encoding: TextEncoding,
pub key_value_pairs: Vec<(String, String)>,
/* private fields */
}Expand description
An ID3v2 key-value frame
Fields§
§encoding: TextEncodingThe encoding of the text
key_value_pairs: Vec<(String, String)>The key value pairs. Keys can be specified multiple times
Implementations§
source§impl<'a> KeyValueFrame<'a>
impl<'a> KeyValueFrame<'a>
sourcepub fn new(
id: FrameId<'a>,
encoding: TextEncoding,
key_value_pairs: Vec<(String, String)>,
) -> Self
pub fn new( id: FrameId<'a>, encoding: TextEncoding, key_value_pairs: Vec<(String, String)>, ) -> Self
Create a new KeyValueFrame
sourcepub fn flags(&self) -> FrameFlags
pub fn flags(&self) -> FrameFlags
Get the flags for the frame
sourcepub fn set_flags(&mut self, flags: FrameFlags)
pub fn set_flags(&mut self, flags: FrameFlags)
Set the flags for the frame
sourcepub fn parse<R>(
reader: &mut R,
id: FrameId<'a>,
frame_flags: FrameFlags,
version: Id3v2Version,
) -> Result<Option<Self>>where
R: Read,
pub fn parse<R>(
reader: &mut R,
id: FrameId<'a>,
frame_flags: FrameFlags,
version: Id3v2Version,
) -> Result<Option<Self>>where
R: Read,
Read an KeyValueFrame from a slice
NOTE: This expects the frame header to have already been skipped
§Errors
- Unable to decode the text
ID3v2.2:
- The encoding is not
TextEncoding::Latin1orTextEncoding::UTF16
sourcepub fn as_bytes(&self) -> Vec<u8>
pub fn as_bytes(&self) -> Vec<u8>
Convert a KeyValueFrame to a byte vec
Trait Implementations§
source§impl<'a> Clone for KeyValueFrame<'a>
impl<'a> Clone for KeyValueFrame<'a>
source§fn clone(&self) -> KeyValueFrame<'a>
fn clone(&self) -> KeyValueFrame<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl<'a> Debug for KeyValueFrame<'a>
impl<'a> Debug for KeyValueFrame<'a>
source§impl<'a> From<KeyValueFrame<'a>> for Frame<'a>
impl<'a> From<KeyValueFrame<'a>> for Frame<'a>
source§fn from(value: KeyValueFrame<'a>) -> Self
fn from(value: KeyValueFrame<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> Hash for KeyValueFrame<'a>
impl<'a> Hash for KeyValueFrame<'a>
source§impl<'a> PartialEq for KeyValueFrame<'a>
impl<'a> PartialEq for KeyValueFrame<'a>
source§fn eq(&self, other: &KeyValueFrame<'a>) -> bool
fn eq(&self, other: &KeyValueFrame<'a>) -> bool
This method tests for
self and other values to be equal, and is used
by ==.impl<'a> Eq for KeyValueFrame<'a>
impl<'a> StructuralPartialEq for KeyValueFrame<'a>
Auto Trait Implementations§
impl<'a> Freeze for KeyValueFrame<'a>
impl<'a> RefUnwindSafe for KeyValueFrame<'a>
impl<'a> Send for KeyValueFrame<'a>
impl<'a> Sync for KeyValueFrame<'a>
impl<'a> Unpin for KeyValueFrame<'a>
impl<'a> UnwindSafe for KeyValueFrame<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more