Struct lofty::id3::v2::AttachedPictureFrame
source · pub struct AttachedPictureFrame<'a> {
pub encoding: TextEncoding,
pub picture: Picture,
/* private fields */
}
Expand description
An ID3v2
attached picture frame
This is simply a wrapper around Picture
to include a TextEncoding
Fields§
§encoding: TextEncoding
The encoding of the description
picture: Picture
The picture itself
Implementations§
source§impl<'a> AttachedPictureFrame<'a>
impl<'a> AttachedPictureFrame<'a>
sourcepub fn new(encoding: TextEncoding, picture: Picture) -> Self
pub fn new(encoding: TextEncoding, picture: Picture) -> Self
Create a new AttachedPictureFrame
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,
frame_flags: FrameFlags,
version: Id3v2Version,
) -> Result<Self>where
R: Read,
pub fn parse<R>(
reader: &mut R,
frame_flags: FrameFlags,
version: Id3v2Version,
) -> Result<Self>where
R: Read,
Get an AttachedPictureFrame
from ID3v2 A/PIC bytes:
NOTE: This expects only the frame content
§Errors
- There isn’t enough data present
- Unable to decode any of the text
ID3v2.2:
- The format is not “PNG” or “JPG”
sourcepub fn as_bytes(&self, version: Id3v2Version) -> Result<Vec<u8>>
pub fn as_bytes(&self, version: Id3v2Version) -> Result<Vec<u8>>
Convert an AttachedPictureFrame
to a ID3v2 A/PIC byte Vec
NOTE: This does not include the frame header
§Errors
- Too much data was provided
ID3v2.2:
- The mimetype is not
MimeType::Png
orMimeType::Jpeg
Trait Implementations§
source§impl<'a> Clone for AttachedPictureFrame<'a>
impl<'a> Clone for AttachedPictureFrame<'a>
source§fn clone(&self) -> AttachedPictureFrame<'a>
fn clone(&self) -> AttachedPictureFrame<'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 AttachedPictureFrame<'a>
impl<'a> Debug for AttachedPictureFrame<'a>
source§impl<'a> From<AttachedPictureFrame<'a>> for Frame<'a>
impl<'a> From<AttachedPictureFrame<'a>> for Frame<'a>
source§fn from(value: AttachedPictureFrame<'a>) -> Self
fn from(value: AttachedPictureFrame<'a>) -> Self
Converts to this type from the input type.
source§impl<'a> Hash for AttachedPictureFrame<'a>
impl<'a> Hash for AttachedPictureFrame<'a>
source§impl<'a> PartialEq for AttachedPictureFrame<'a>
impl<'a> PartialEq for AttachedPictureFrame<'a>
source§fn eq(&self, other: &AttachedPictureFrame<'a>) -> bool
fn eq(&self, other: &AttachedPictureFrame<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> Eq for AttachedPictureFrame<'a>
impl<'a> StructuralPartialEq for AttachedPictureFrame<'a>
Auto Trait Implementations§
impl<'a> Freeze for AttachedPictureFrame<'a>
impl<'a> RefUnwindSafe for AttachedPictureFrame<'a>
impl<'a> Send for AttachedPictureFrame<'a>
impl<'a> Sync for AttachedPictureFrame<'a>
impl<'a> Unpin for AttachedPictureFrame<'a>
impl<'a> UnwindSafe for AttachedPictureFrame<'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