Skip to main content

DataType

Enum DataType 

Source
#[repr(u32)]
pub enum DataType {
Show 28 variants Reserved = 0, Utf8 = 1, Utf16 = 2, SJis = 3, Utf8Sort = 4, Utf16Sort = 5, Gif = 12, Jpeg = 13, Png = 14, BeSignedInteger = 21, BeUnsignedInteger = 22, BeFloat32 = 23, BeFloat64 = 24, Bmp = 27, QuicktimeMetadata = 28, Signed8BitInteger = 65, Be16BitSignedInteger = 66, Be32BitSignedInteger = 67, BePointF32 = 70, BeDimensionsF32 = 71, BeRectF32 = 72, Be64BitSignedInteger = 74, Unsigned8BitInteger = 75, Be16BitUnsignedInteger = 76, Be32BitUnsignedInteger = 77, Be64BitUnsignedInteger = 78, AffineTransformF64 = 79, Other(u32),
}
Expand description

The well known basic data types

This should cover all the data types you’ll encounter in an MP4 file.

Variants§

§

Reserved = 0

Reserved for use where no type needs to be indicated

§

Utf8 = 1

UTF-8 string without any count or NULL terminator

§

Utf16 = 2

A big-endian UTF-16 string

§

SJis = 3

Deprecated unless it is needed for special Japanese characters

§

Utf8Sort = 4

The UTF-8 variant storage of a string for sorting only

§

Utf16Sort = 5

The UTF-16 variant storage of a string for sorting only

§

Gif = 12

DEPRECATED A GIF image

§

Jpeg = 13

A JPEG in a JFIF wrapper

§

Png = 14

A PNG in a PNG wrapper

§

BeSignedInteger = 21

A big-endian signed integer in 1,2,3 or 4 bytes

§

BeUnsignedInteger = 22

A big-endian unsigned integer in 1,2,3 or 4 bytes; size of value determines integer size

§

BeFloat32 = 23

A big-endian 32-bit floating point value (IEEE754)

§

BeFloat64 = 24

A big-endian 64-bit floating point value (IEEE754)

§

Bmp = 27

Windows bitmap format graphics

§

QuicktimeMetadata = 28

A QuickTime metadata atom

§

Signed8BitInteger = 65

An 8-bit signed integer

§

Be16BitSignedInteger = 66

A big-endian 16-bit signed integer

§

Be32BitSignedInteger = 67

A big-endian 32-bit signed integer

§

BePointF32 = 70

A block of data representing a two dimensional (2D) point with 32-bit big-endian floating point x and y coordinates. It has the structure:

struct {
    BEFloat32 x;
    BEFloat32 y;
}
§

BeDimensionsF32 = 71

A block of data representing 2D dimensions with 32-bit big-endian floating point width and height. It has the structure:

struct {
    BEFloat32 width;
    BEFloat32 height;
}
§

BeRectF32 = 72

A block of data representing a 2D rectangle with 32-bit big-endian floating point x and y coordinates and a 32-bit big-endian floating point width and height size. It has the structure:

struct {
    BEFloat32 x;
    BEFloat32 y;
    BEFloat32 width;
    BEFloat32 height;
}

or the equivalent structure:

struct {
    PointF32 origin;
    DimensionsF32 size;
}
§

Be64BitSignedInteger = 74

A big-endian 64-bit signed integer

§

Unsigned8BitInteger = 75

An 8-bit unsigned integer

§

Be16BitUnsignedInteger = 76

A big-endian 16-bit unsigned integer

§

Be32BitUnsignedInteger = 77

A big-endian 32-bit unsigned integer

§

Be64BitUnsignedInteger = 78

A big-endian 64-bit unsigned integer

§

AffineTransformF64 = 79

A block of data representing a 3x3 transformation matrix. It has the structure:

struct {
   BEFloat64 matrix[3][3];
}
§

Other(u32)

Some other data type

Implementations§

Source§

impl DataType

Source

pub const MAX: u32 = 16_777_215

A data type can only occupy 24 bits

Trait Implementations§

Source§

impl Clone for DataType

Source§

fn clone(&self) -> DataType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DataType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&MimeType> for DataType

Source§

fn from(value: &MimeType) -> Self

Converts to this type from the input type.
Source§

impl From<DataType> for u32

Source§

fn from(value: DataType) -> Self

Converts to this type from the input type.
Source§

impl From<MimeType> for DataType

Source§

fn from(value: MimeType) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for DataType

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl Hash for DataType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Ord for DataType

Source§

fn cmp(&self, other: &DataType) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl PartialEq for DataType

Source§

fn eq(&self, other: &DataType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for DataType

Source§

fn partial_cmp(&self, other: &DataType) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Copy for DataType

Source§

impl Eq for DataType

Source§

impl StructuralPartialEq for DataType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.