Struct midly::SmfBytemap
source · 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: Header
The 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 copy 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<SmfBytemap<'a>> for SmfBytemap<'a>
impl<'a> PartialEq<SmfBytemap<'a>> for SmfBytemap<'a>
source§fn eq(&self, other: &SmfBytemap<'a>) -> bool
fn eq(&self, other: &SmfBytemap<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.