Skip to main content

MdatParser

Struct MdatParser 

Source
pub struct MdatParser<R, C: ReadCapability> { /* private fields */ }

Implementations§

Source§

impl<R, C: ReadCapability> MdatParser<R, C>

Source

pub fn into_metadata(self) -> Metadata

Discards the reader and returns just the metadata

Source

pub fn mdat_header(&self) -> Option<&AtomHeader>

Source

pub fn chunks(&mut self) -> Result<ChunkParser<'_, R, C>, ParseError>

Parse chunks along with related metadata

Methods from Deref<Target = Metadata>§

Source

pub fn atoms_iter(&self) -> impl Iterator<Item = &Atom>

Iterates over the metadata atoms

Source

pub fn atoms_iter_mut(&mut self) -> impl Iterator<Item = &mut Atom>

Mutably iterates over the metadata atoms

Source

pub fn atoms_flat_retain_mut<P>(&mut self, pred: P)
where P: FnMut(&mut Atom) -> bool,

Retains only the metadata atoms that satisfy the predicate (applies to top level and nested atoms)

Source

pub fn ftyp(&mut self) -> FtypAtomRef<'_>

Source

pub fn ftyp_mut(&mut self) -> FtypAtomRefMut<'_>

Source

pub fn moov(&self) -> MoovAtomRef<'_>

Source

pub fn moov_mut(&mut self) -> MoovAtomRefMut<'_>

Source

pub fn metadata_size(&self) -> usize

Returns the sum of all metadata atom sizes in bytes

Source

pub fn mdat_size(&self) -> usize

Returns the sum of all track sizes in bytes

Source

pub fn file_size(&self) -> usize

Returns the sum of metadata_size and mdat_size

Source

pub fn update_chunk_offsets( &mut self, ) -> Result<BuildMetadata, UpdateChunkOffsetError>

Updates chunk offsets for each track

Call this before writing metadata to disk to avoid corruption

Trait Implementations§

Source§

impl<R, C: ReadCapability> Clone for MdatParser<R, C>

Source§

fn clone(&self) -> Self

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<R, C: ReadCapability> Deref for MdatParser<R, C>

Source§

type Target = Metadata

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<R, C: ReadCapability> DerefMut for MdatParser<R, C>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<R, C> Freeze for MdatParser<R, C>
where R: Freeze,

§

impl<R, C> RefUnwindSafe for MdatParser<R, C>

§

impl<R, C> Send for MdatParser<R, C>
where R: Send, C: Send,

§

impl<R, C> Sync for MdatParser<R, C>
where R: Sync, C: Sync,

§

impl<R, C> Unpin for MdatParser<R, C>
where R: Unpin, C: Unpin,

§

impl<R, C> UnsafeUnpin for MdatParser<R, C>
where R: UnsafeUnpin,

§

impl<R, C> UnwindSafe for MdatParser<R, C>
where R: UnwindSafe, C: UnwindSafe,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.