pub struct Atom<'a> { /* private fields */ }Expand description
Represents an MP4 atom
Implementations§
source§impl<'a> Atom<'a>
impl<'a> Atom<'a>
sourcepub fn merge(&mut self, other: Atom<'_>) -> Result<()>
pub fn merge(&mut self, other: Atom<'_>) -> Result<()>
Merge the data of another atom into this one
NOTE: Both atoms must have the same identifier
§Errors
self.ident()!=other.ident()
§Examples
use lofty::mp4::{Atom, AtomData, AtomIdent};
// Create an artist atom
let mut atom = Atom::new(
AtomIdent::Fourcc(*b"\x49ART"),
AtomData::UTF8(String::from("foo")),
);
// Create a second and merge it into the first
let atom2 = Atom::new(
AtomIdent::Fourcc(*b"\x49ART"),
AtomData::UTF8(String::from("bar")),
);
atom.merge(atom2)?;
// Our first atom now contains the second atom's content
assert_eq!(atom.data().count(), 2);Trait Implementations§
impl<'a> StructuralPartialEq for Atom<'a>
Auto Trait Implementations§
impl<'a> Freeze for Atom<'a>
impl<'a> RefUnwindSafe for Atom<'a>
impl<'a> Send for Atom<'a>
impl<'a> Sync for Atom<'a>
impl<'a> Unpin for Atom<'a>
impl<'a> UnwindSafe for Atom<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)