Struct lofty::Picture [−][src]
pub struct Picture { pub pic_type: PictureType, pub mime_type: MimeType, pub description: Option<Cow<'static, str>>, pub data: Cow<'static, [u8]>, }
Expand description
Represents a picture, with its data and mime type.
Fields
pic_type: PictureType
The picture type
mime_type: MimeType
The picture’s mimetype
description: Option<Cow<'static, str>>
The picture’s description
data: Cow<'static, [u8]>
The picture’s actual data
Implementations
impl Picture
[src]
impl Picture
[src]pub fn new(
pic_type: PictureType,
mime_type: MimeType,
description: Option<Cow<'static, str>>,
data: Cow<'static, [u8]>
) -> Self
[src]
pub fn new(
pic_type: PictureType,
mime_type: MimeType,
description: Option<Cow<'static, str>>,
data: Cow<'static, [u8]>
) -> Self
[src]Create a new Picture
pub fn as_apic_bytes(&self) -> Vec<u8>
[src]
pub fn as_apic_bytes(&self) -> Vec<u8>
[src]Convert the Picture
back to an APIC byte vec:
- Id3v2 APIC
- Vorbis METADATA_BLOCK_PICTURE
pub fn from_apic_bytes(bytes: &[u8]) -> Result<Self>
[src]
pub fn from_apic_bytes(bytes: &[u8]) -> Result<Self>
[src]Get a Picture
from APIC bytes:
- Id3v2 APIC
- Vorbis METADATA_BLOCK_PICTURE
Errors
This function will return Error::InvalidData
if at any point it’s unable to parse the data
pub fn as_ape_bytes(&self) -> Vec<u8>
[src]
pub fn as_ape_bytes(&self) -> Vec<u8>
[src]Convert the Picture
back to an APEv2 byte vec:
- APEv2 Cover Art
pub fn from_ape_bytes(key: &str, bytes: &[u8]) -> Result<Self>
[src]
pub fn from_ape_bytes(key: &str, bytes: &[u8]) -> Result<Self>
[src]Get a Picture
from APEv2 bytes:
- APEv2 Cover Art
Errors
This function will return Error::InvalidData
if at any point it’s unable to parse the data
Trait Implementations
impl Eq for Picture
[src]
impl StructuralEq for Picture
[src]
impl StructuralPartialEq for Picture
[src]
Auto Trait Implementations
impl RefUnwindSafe for Picture
impl Send for Picture
impl Sync for Picture
impl Unpin for Picture
impl UnwindSafe for Picture
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more