pub struct MidiPacket { /* private fields */ }Expand description
A MIDI payload: an ordered run of MidiPacketEvents sharing one TPQ
resolution.
Implementations§
Source§impl MidiPacket
impl MidiPacket
Sourcepub fn new(events: Vec<MidiPacketEvent>) -> Result<Self>
pub fn new(events: Vec<MidiPacketEvent>) -> Result<Self>
Builds a packet from its events, adopting the TPQ of the first event.
Returns an error when events is empty or any event uses a different
TPQ than the first; a packet carries a single shared resolution.
Sourcepub fn events(&self) -> &[MidiPacketEvent]
pub fn events(&self) -> &[MidiPacketEvent]
Returns the packet’s events in order.
Trait Implementations§
Source§impl Clone for MidiPacket
impl Clone for MidiPacket
Source§fn clone(&self) -> MidiPacket
fn clone(&self) -> MidiPacket
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for MidiPacket
impl Debug for MidiPacket
impl Eq for MidiPacket
Source§impl PartialEq for MidiPacket
impl PartialEq for MidiPacket
Source§fn eq(&self, other: &MidiPacket) -> bool
fn eq(&self, other: &MidiPacket) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for MidiPacket
Auto Trait Implementations§
impl Freeze for MidiPacket
impl RefUnwindSafe for MidiPacket
impl Send for MidiPacket
impl Sync for MidiPacket
impl Unpin for MidiPacket
impl UnsafeUnpin for MidiPacket
impl UnwindSafe for MidiPacket
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