pub struct Frame<'a> { /* private fields */ }
Expand description
Represents an ID3v2
frame
Outdated Frames
ID3v2.2
ID3v2.2
frame IDs are 3 characters. When reading these tags, upgrade_v2
is used, which has a list of all of the common IDs
that have a mapping to ID3v2.4
. Any ID that fails to be converted will be stored as FrameId::Outdated
, and it must be manually
upgraded before it can be written. Lofty will not write ID3v2.2
tags.
ID3v2.3
ID3v2.3
, unlike ID3v2.2
, stores frame IDs in 4 characters like ID3v2.4
. There are some IDs that need upgrading (See upgrade_v3
),
but anything that fails to be upgraded will not be stored as FrameId::Outdated
, as it is likely not an issue to write.
Implementations§
source§impl<'a> Frame<'a>
impl<'a> Frame<'a>
sourcepub fn new<I, V>(id: I, value: V, flags: FrameFlags) -> Result<Self>where
I: Into<Cow<'a, str>>,
V: Into<FrameValue>,
pub fn new<I, V>(id: I, value: V, flags: FrameFlags) -> Result<Self>where I: Into<Cow<'a, str>>, V: Into<FrameValue>,
Create a new frame
NOTE: This will accept both ID3v2.2
and ID3v2.3/4
frame IDs
Errors
id
is less than 3 or greater than 4 bytesid
contains non-ascii characters
sourcepub fn content(&self) -> &FrameValue
pub fn content(&self) -> &FrameValue
Returns the frame’s content
sourcepub fn flags(&self) -> &FrameFlags
pub fn flags(&self) -> &FrameFlags
Returns a reference to the FrameFlags
sourcepub fn set_flags(&mut self, flags: FrameFlags)
pub fn set_flags(&mut self, flags: FrameFlags)
Set the item’s flags