[][src]Enum mp4ameta::Content

pub enum Content {
    Atoms(Vec<Atom>),
    RawData(Data),
    TypedData(Data),
    Empty,
}

A structure representing the different types of content an Atom might have.

Variants

Atoms(Vec<Atom>)

A value containing Vec<Atom>.

RawData(Data)

A value containing raw Data.

TypedData(Data)

A value containing Data defined by a Table 3-5 Well-known data types code.

Empty

Empty Content.

Methods

impl Content[src]

pub fn atoms() -> Content[src]

Creates a new content of type Content::Atoms containing an empty Vec.

pub fn atom(atom: Atom) -> Content[src]

Creates a new content of type Content::Atoms containing the atom.

pub fn data_atom() -> Content[src]

Creates a new content of type Content::Atoms containing a data Atom.

pub fn data_atom_with(data: Data) -> Content[src]

Creates a new content of type Content::Atoms containing a data Atom with the data.

pub fn atom_with(head: [u8; 4], offset: usize, content: Content) -> Content[src]

Creates a new Content of type Content::Atoms containing a new Atom with the head, offset and content.

pub fn add_atom(self, atom: Atom) -> Content[src]

Adds the atom to the list of children atoms if self is of type Content::Atoms.

pub fn add_data_atom(self) -> Content[src]

Adds a data Atom to the list of children if self is of type Content::Atoms.

pub fn add_atom_with(
    self,
    head: [u8; 4],
    offset: usize,
    content: Content
) -> Content
[src]

Adds a new Atom with the provided head, offset and content to the list of children if self is of type Content::Atoms.

pub fn len(&self) -> usize[src]

Returns the length in bytes.

pub fn parse(
    &mut self,
    reader: &mut impl Read + Seek,
    length: usize
) -> Result<()>
[src]

Attempts to parse itself from the reader.

pub fn write_to(&self, writer: &mut impl Write) -> Result<()>[src]

Trait Implementations

impl Clone for Content[src]

impl Debug for Content[src]

impl PartialEq<Content> for Content[src]

Auto Trait Implementations

impl RefUnwindSafe for Content

impl Send for Content

impl Sync for Content

impl Unpin for Content

impl UnwindSafe for Content

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.