pub struct SmfBytemap<'a> {
pub header: Header,
pub tracks: Vec<BytemappedTrack<'a>>,
}Expand description
A .mid Standard Midi File, but keeps a mapping to the raw bytes that make up each event.
This type is only available with the alloc feature enabled.
Fields§
§header: HeaderThe header of this file.
tracks: Vec<BytemappedTrack<'a>>A list of tracks, along with the bytemap of their events.
Implementations§
Source§impl<'a> SmfBytemap<'a>
impl<'a> SmfBytemap<'a>
Sourcepub fn new(header: Header) -> SmfBytemap<'a>
pub fn new(header: Header) -> SmfBytemap<'a>
Create a new empty SmfBytemap with zero tracks, using the given header.
Sourcepub fn parse(raw: &[u8]) -> Result<SmfBytemap<'_>>
pub fn parse(raw: &[u8]) -> Result<SmfBytemap<'_>>
Parse a Standard Midi File from its raw bytes, keeping a map to the original bytes that make up each event.
Sourcepub fn write<W: Write>(&self, out: &mut W) -> WriteResult<W>
pub fn write<W: Write>(&self, out: &mut W) -> WriteResult<W>
Encodes and writes the events (not the bytemap) to the given generic writer.
Trait Implementations§
Source§impl<'a> Clone for SmfBytemap<'a>
impl<'a> Clone for SmfBytemap<'a>
Source§fn clone(&self) -> SmfBytemap<'a>
fn clone(&self) -> SmfBytemap<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for SmfBytemap<'a>
impl<'a> Debug for SmfBytemap<'a>
Source§impl<'a> Hash for SmfBytemap<'a>
impl<'a> Hash for SmfBytemap<'a>
Source§impl<'a> PartialEq for SmfBytemap<'a>
impl<'a> PartialEq for SmfBytemap<'a>
impl<'a> Eq for SmfBytemap<'a>
impl<'a> StructuralPartialEq for SmfBytemap<'a>
Auto Trait Implementations§
impl<'a> Freeze for SmfBytemap<'a>
impl<'a> RefUnwindSafe for SmfBytemap<'a>
impl<'a> Send for SmfBytemap<'a>
impl<'a> Sync for SmfBytemap<'a>
impl<'a> Unpin for SmfBytemap<'a>
impl<'a> UnwindSafe for SmfBytemap<'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§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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