pub struct UsbMidiEventPacket { /* private fields */ }Expand description
A packet that communicates with the host.
Currently supported is sending the specified normal midi message over the supplied cable number
Implementations§
Source§impl UsbMidiEventPacket
impl UsbMidiEventPacket
Sourcepub fn cable_number(&self) -> CableNumber
pub fn cable_number(&self) -> CableNumber
Returns the cable number.
Sourcepub fn payload_bytes(&self) -> &[u8]
pub fn payload_bytes(&self) -> &[u8]
Returns a slice to the event payload bytes. The length is dependent on the payload type.
Sourcepub fn as_raw_bytes(&self) -> &[u8]
pub fn as_raw_bytes(&self) -> &[u8]
Returns a reference to the raw bytes.
Sourcepub fn to_raw_bytes(&self) -> [u8; 4]
pub fn to_raw_bytes(&self) -> [u8; 4]
Returns the raw bytes as owned array.
Sourcepub fn try_from_payload_bytes(
cable: CableNumber,
bytes: &[u8],
) -> Result<Self, UsbMidiEventPacketError>
pub fn try_from_payload_bytes( cable: CableNumber, bytes: &[u8], ) -> Result<Self, UsbMidiEventPacketError>
Creates a packet from a slice of event payload bytes.
Sourcepub fn is_sysex_start(&self) -> bool
pub fn is_sysex_start(&self) -> bool
Returns if the packet payload contains the start of a SysEx message.
Sourcepub fn is_sysex_end(&self) -> bool
pub fn is_sysex_end(&self) -> bool
Returns if the packet payload contains the end of a SysEx message.
Trait Implementations§
Source§impl Clone for UsbMidiEventPacket
impl Clone for UsbMidiEventPacket
Source§fn clone(&self) -> UsbMidiEventPacket
fn clone(&self) -> UsbMidiEventPacket
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 Debug for UsbMidiEventPacket
impl Debug for UsbMidiEventPacket
Source§impl PartialEq for UsbMidiEventPacket
impl PartialEq for UsbMidiEventPacket
Source§impl TryFrom<&[u8]> for UsbMidiEventPacket
impl TryFrom<&[u8]> for UsbMidiEventPacket
Source§impl TryFrom<&UsbMidiEventPacket> for Message
impl TryFrom<&UsbMidiEventPacket> for Message
Source§type Error = UsbMidiEventPacketError
type Error = UsbMidiEventPacketError
The type returned in the event of a conversion error.
impl Eq for UsbMidiEventPacket
impl StructuralPartialEq for UsbMidiEventPacket
Auto Trait Implementations§
impl Freeze for UsbMidiEventPacket
impl RefUnwindSafe for UsbMidiEventPacket
impl Send for UsbMidiEventPacket
impl Sync for UsbMidiEventPacket
impl Unpin for UsbMidiEventPacket
impl UnwindSafe for UsbMidiEventPacket
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