pub enum Data {
Reserved(Vec<u8>),
Utf8(String),
Utf16(String),
Jpeg(Vec<u8>),
Png(Vec<u8>),
Bmp(Vec<u8>),
BeSigned(Vec<u8>),
Unknown {
code: u32,
data: Vec<u8>,
},
}Expand description
Different types of data defined by Table 3-5 Well-known data types.
Variants§
Reserved(Vec<u8>)
Reserved for use where no type needs to be indicated. This is often used for track/disc numbers and standard genre codes.
Utf8(String)
A utf-8 encoded string.
Utf16(String)
A utf-16 encoded string.
Jpeg(Vec<u8>)
A JPEG image. Note that this type is more of a hint and many encoders use any of the image formats for all kinds of image data.
Png(Vec<u8>)
A PNG image. Note that this type is more of a hint and many encoders use any of the image formats for all kinds of image data.
Bmp(Vec<u8>)
A BMP image. Note that this type is more of a hint and many encoders use any of the image formats for all kinds of image data.
BeSigned(Vec<u8>)
A big-endian signed integer. This is often used for track/disc numbers and standard genre codes.
Unknown
A value containing an unknown data type code and data.
Implementations§
Source§impl Data
impl Data
Sourcepub fn data_len(&self) -> u64
pub fn data_len(&self) -> u64
Returns the length of the raw data (without version, datatype and locale header) in bytes.
Sourcepub const fn is_reserved(&self) -> bool
pub const fn is_reserved(&self) -> bool
Returns true if the data is of type Reserved.
Sourcepub const fn is_be_signed(&self) -> bool
pub const fn is_be_signed(&self) -> bool
Returns true if the data is of type BeSigned.
Sourcepub fn into_bytes(self) -> Option<Vec<u8>>
pub fn into_bytes(self) -> Option<Vec<u8>>
Sourcepub fn string_mut(&mut self) -> Option<&mut String>
pub fn string_mut(&mut self) -> Option<&mut String>
Sourcepub fn into_string(self) -> Option<String>
pub fn into_string(self) -> Option<String>
Sourcepub fn into_image(self) -> Option<ImgBuf>
pub fn into_image(self) -> Option<ImgBuf>
Sourcepub fn image_data(&self) -> Option<&[u8]>
pub fn image_data(&self) -> Option<&[u8]>
Sourcepub fn image_data_mut(&mut self) -> Option<&mut Vec<u8>>
pub fn image_data_mut(&mut self) -> Option<&mut Vec<u8>>
Sourcepub fn into_image_data(self) -> Option<Vec<u8>>
pub fn into_image_data(self) -> Option<Vec<u8>>
Sourcepub fn reserved(&self) -> Option<&[u8]>
pub fn reserved(&self) -> Option<&[u8]>
Returns a byte reference if the data is of type Reserved.