[−][src]Struct mp4ameta::Atom
A structure that represents a MPEG-4 audio metadata atom.
Fields
identifier: [u8; 4]
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.
Methods
impl Atom
[src]
pub fn new() -> Atom
[src]
Creates a new empty atom.
pub fn with(identifier: [u8; 4], offset: usize, content: Content) -> Atom
[src]
Creates an atom containing the provided content at a n byte offset.
pub fn with_raw_data(identifier: [u8; 4], offset: usize, data: Data) -> Atom
[src]
Creates an atom containing Content::RawData
with the provided data.
pub fn data_atom() -> Atom
[src]
Creates a data atom containing unparsed Content::TypedData
.
pub fn data_atom_with(data: Data) -> Atom
[src]
Creates a data atom containing Content::TypedData
with the provided data.
pub fn len(&self) -> usize
[src]
Returns the length in bytes.
pub fn read_from(reader: &mut impl Read + Seek) -> Result<Tag>
[src]
Attempts to read MPEG-4 audio metadata from the reader.
pub fn write_to(&self, writer: &mut impl Write) -> Result<()>
[src]
Attempts to write the atom to the writer.
pub fn parse(&mut self, reader: &mut impl Read + Seek) -> Result<()>
[src]
Attempts to parse itself from the reader.
pub fn parse_atoms(
atoms: &mut Vec<Atom>,
reader: &mut impl Read + Seek,
length: usize
) -> Result<()>
[src]
atoms: &mut Vec<Atom>,
reader: &mut impl Read + Seek,
length: usize
) -> Result<()>
Attempts to parse the list of atoms from the reader.
pub fn locate_metadata_item_list(
reader: &mut impl Read + Seek
) -> Result<Vec<(usize, usize)>>
[src]
reader: &mut impl Read + Seek
) -> Result<Vec<(usize, usize)>>
Locates the metadata item list atom and returns a list of tuples containing the position from the beginning of the file and length in bytes of the atoms inside the hierarchy leading to it.
pub fn parse_head(reader: &mut impl Read + Seek) -> Result<(usize, [u8; 4])>
[src]
Attempts to parse the atoms head containing a 32 bit unsigned integer determining the size of the atom in bytes and the following 4 byte identifier from the reader.
pub fn parse_content(
&mut self,
reader: &mut impl Read + Seek,
length: usize
) -> Result<()>
[src]
&mut self,
reader: &mut impl Read + Seek,
length: usize
) -> Result<()>
Attempts to parse the content of the provided length from the reader.
pub fn child(&self, identifier: [u8; 4]) -> Option<&Atom>
[src]
Attempts to return a reference to the first children atom matching the identifier.
pub fn mut_child(&mut self, identifier: [u8; 4]) -> Option<&mut Atom>
[src]
Attempts to return a mutable reference to the first children atom matching the identifier.
pub fn first_child(&self) -> Option<&Atom>
[src]
Attempts to return a reference to the first children atom.
pub fn mut_first_child(&mut self) -> Option<&mut Atom>
[src]
Attempts to return a mutable reference to the first children atom.
pub fn is_valid_filetype(&self) -> bool
[src]
Return true if the filetype specified in the ftyp
atom is valid, false otherwise.
pub fn filetype_atom() -> Atom
[src]
Returns a atom filetype hierarchy needed to parse the filetype:
pub fn metadata_atom() -> Atom
[src]
Returns a atom metadata hierarchy needed to parse metadata.
pub fn item_list_atom() -> Atom
[src]
Returns a atom metadata hierarchy.
pub fn format_identifier(identifier: [u8; 4]) -> String
[src]
Returns the identifier formatted as a string.
Trait Implementations
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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,