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
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 duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const 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>
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