Enum mp4ameta::Data [−][src]
pub enum Data {
Reserved(Vec<u8>),
Utf8(String),
Utf16(String),
Jpeg(Vec<u8>),
Png(Vec<u8>),
BeSigned(Vec<u8>),
Bmp(Vec<u8>),
}An enum that holds different types of data defined by Table 3-5 Well-known data types.
Variants
A value containing reserved type data inside a Vec<u8>.
Utf8(String)A value containing a String decoded from, or to be encoded to utf-8.
Utf16(String)A value containing a String decoded from, or to be encoded to utf-16.
A value containing jpeg byte data inside a Vec<u8>.
A value containing png byte data inside a Vec<u8>.
A value containing big endian signed integer inside a Vec<u8>.
A value containing bmp byte data inside a Vec<u8>.
Implementations
impl Data[src]
impl Data[src]pub fn len(&self) -> u64[src]
Returns the length in bytes.
pub fn is_empty(&self) -> bool[src]
Returns true if the data is empty, false otherwise.
pub const fn is_bytes(&self) -> bool[src]
Returns true if self is of type Self::Reserved or Self::BeSigned, false otherwise.
pub const fn is_string(&self) -> bool[src]
Returns true if self is of type Self::Utf8 or Self::Utf16, false otherwise.
pub const fn is_image(&self) -> bool[src]
Returns true if self is of type Self::Jpeg, Self::Png or Self::Bmp false otherwise.
pub const fn is_reserved(&self) -> bool[src]
Returns true if self is of type Self::Reserved false otherwise.
pub const fn is_utf8(&self) -> bool[src]
Returns true if self is of type Self::Utf8 false otherwise.
pub const fn is_utf16(&self) -> bool[src]
Returns true if self is of type Self::Utf16 false otherwise.
pub const fn is_jpeg(&self) -> bool[src]
Returns true if self is of type Self::Jpeg false otherwise.
pub const fn is_png(&self) -> bool[src]
Returns true if self is of type Self::Png false otherwise.
pub const fn is_be_signed(&self) -> bool[src]
Returns true if self is of type Self::BeSigned false otherwise.
pub const fn is_bmp(&self) -> bool[src]
Returns true if self is of type Self::Bmp false otherwise.
pub const fn bytes(&self) -> Option<&Vec<u8>>[src]
Returns a byte vec reference if self is of type Self::Reserved or Self::BeSigned.
pub fn bytes_mut(&mut self) -> Option<&mut Vec<u8>>[src]
Returns a mutable byte vec reference if self is of type Self::Reserved or
Self::BeSigned.
pub fn take_bytes(self) -> Option<Vec<u8>>[src]
Consumes self and returns a byte vec if self is of type Self::Reserved or
Self::BeSigned.
pub fn string(&self) -> Option<&str>[src]
Returns a string reference if self is either of type Self::Utf8 or Self::Utf16.
pub fn string_mut(&mut self) -> Option<&mut String>[src]
Returns a mutable string reference if self is either of type Self::Utf8 or
Self::Utf16.
pub fn take_string(self) -> Option<String>[src]
Consumes self and returns a string if self is either of type Self::Utf8 or
Self::Utf16.
pub const fn image(&self) -> Option<&Data>[src]
Returns a data reference if self is of type Self::Jpeg, Self::Png or
Self::Bmp.
pub fn image_mut(&mut self) -> Option<&mut Data>[src]
Returns a data reference if self is of type Self::Jpeg, Self::Png or
Self::Bmp.
pub fn take_image(self) -> Option<Data>[src]
Consumes self and returns data if self is of type Self::Jpeg, Self::Png or
Self::Bmp.
pub const fn image_data(&self) -> Option<&Vec<u8>>[src]
Returns a byte vec reference if self is of type Self::Jpeg, Self::Png or
Self::Bmp.
pub fn image_data_mut(&mut self) -> Option<&mut Vec<u8>>[src]
Returns a mutable byte vec reference if self is of type Self::Jpeg, Self::Png or
Self::Bmp.
pub fn take_image_data(self) -> Option<Vec<u8>>[src]
Consumes self and returns a byte vec if self is of type Self::Jpeg, Self::Png
or Self::Bmp.
pub const fn reserved(&self) -> Option<&Vec<u8>>[src]
Returns a byte vec reference if self is of type Self::Reserved.
pub const fn utf8(&self) -> Option<&String>[src]
Returns a string reference if self is of type Self::Utf8.
pub const fn utf16(&self) -> Option<&String>[src]
Returns a string reference if self is of type Self::Utf16.
pub const fn jpeg(&self) -> Option<&Vec<u8>>[src]
Returns a byte vec reference if self is of type Self::Jpeg.
pub const fn png(&self) -> Option<&Vec<u8>>[src]
Returns a byte vec reference if self is of type Self::Png.
pub const fn be_signed(&self) -> Option<&Vec<u8>>[src]
Returns a byte vec reference if self is of type Self::BeSigned.
pub const fn bmp(&self) -> Option<&Vec<u8>>[src]
Returns a byte vec reference if self is of type Self::Bmp.
pub fn write_typed(&self, writer: &mut impl Write) -> Result<()>[src]
Attempts to write the typed data to the writer.
pub fn write_raw(&self, writer: &mut impl Write) -> Result<()>[src]
Attempts to write the raw data to the writer.
Trait Implementations
impl StructuralEq for Data[src]
impl StructuralEq for Data[src]impl StructuralPartialEq for Data[src]
impl StructuralPartialEq for Data[src]Auto Trait Implementations
impl RefUnwindSafe for Data
impl RefUnwindSafe for Dataimpl UnwindSafe for Data
impl UnwindSafe for Data