[][src]Struct mp4ameta::AtomT

pub struct AtomT {
    pub ident: Ident,
    pub offset: usize,
    pub content: ContentT,
}

A template representing a MPEG-4 audio metadata atom.

Fields

ident: Ident

The 4 byte identifier of the atom.

offset: usize

The offset in bytes separating the head from the content.

content: ContentT

The content template of an atom template.

Implementations

impl AtomT[src]

pub fn with(ident: Ident, offset: usize, content: ContentT) -> Self[src]

Creates an atom template containing the provided content at a n byte offset.

pub fn with_raw_data(ident: Ident, offset: usize, data: DataT) -> Self[src]

Creates an atom template containing ContentT::RawData with the provided data template.

pub fn data_atom() -> Self[src]

Creates a data atom template containing ContentT::TypedData.

pub fn child(&self, ident: Ident) -> Option<&Self>[src]

Returns a reference to the first children atom template matching the identifier, if present.

pub fn mut_child(&mut self, ident: Ident) -> Option<&mut Self>[src]

Returns a mutable reference to the first children atom template matching the identifier, if present.

pub fn first_child(&self) -> Option<&Self>[src]

Returns a reference to the first children atom template, if present.

pub fn mut_first_child(&mut self) -> Option<&mut Self>[src]

Returns a mutable reference to the first children atom template, if present.

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

Attempts to parse an atom, that matches the template, from the reader. This should only be used if the atom has to be in this exact position, if the parsed and expected identifiers don't match this will return an error.

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

Attempts to parse an atom, that matches the template, from the reader.

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

Attempts to parse the atom template's content from the reader.

Trait Implementations

impl Clone for AtomT[src]

impl Debug for AtomT[src]

impl PartialEq<AtomT> for AtomT[src]

impl StructuralPartialEq for AtomT[src]

Auto Trait Implementations

impl RefUnwindSafe for AtomT

impl Send for AtomT

impl Sync for AtomT

impl Unpin for AtomT

impl UnwindSafe for AtomT

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.