[][src]Struct mp4ameta::Atom

pub struct Atom {
    pub ident: Ident,
    pub offset: usize,
    pub content: Content,
}

A struct that represents 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: Content

The content of an atom.

Implementations

impl Atom[src]

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

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

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

Creates an atom with the identifier, containing Content::RawData with the provided data.

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

Creates an atom with the identifier, containing Content::TypedData with the provided data.

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

Creates a data atom containing Content::TypedData with the provided data.

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

Returns the length of the atom in bytes.

pub fn is_empty(&self) -> bool[src]

Returns true if the atom has no offset or content and only consists of it's 8 byte head.

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

Returns a reference to the first children atom 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 matching the identifier, if present.

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

Return a reference to the first children atom, if present.

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

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

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

Attempts to write the atom to the writer.

pub fn check_filetype(&self) -> Result<()>[src]

Checks if the filetype is valid, returns an error otherwise.

Trait Implementations

impl Clone for Atom[src]

impl Debug for Atom[src]

impl PartialEq<Atom> for Atom[src]

impl StructuralPartialEq for Atom[src]

Auto Trait Implementations

impl RefUnwindSafe for Atom

impl Send for Atom

impl Sync for Atom

impl Unpin for Atom

impl UnwindSafe for Atom

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.