pub struct UmpPacket {
pub words: [u32; 4],
pub word_count: u8,
}Expand description
A fixed-capacity Universal MIDI Packet (1..=4 valid 32-bit words).
Fields§
§words: [u32; 4]Packet words, big-endian per the spec; only word_count are valid.
word_count: u8Number of valid words (1..=4).
Implementations§
Source§impl UmpPacket
impl UmpPacket
Sourcepub const fn new128(word0: u32, word1: u32, word2: u32, word3: u32) -> Self
pub const fn new128(word0: u32, word1: u32, word2: u32, word3: u32) -> Self
A 128-bit (4-word) packet.
Sourcepub const fn message_type(self) -> u8
pub const fn message_type(self) -> u8
The Message Type (top nibble of word 0), 0x0..=0xF.
Sourcepub fn to_be_bytes(self, out: &mut [u8]) -> Result<usize, AudioError>
pub fn to_be_bytes(self, out: &mut [u8]) -> Result<usize, AudioError>
Write the valid words as big-endian bytes into out; returns bytes
written (word_count * 4). Errors AudioError::OutputBufferTooSmall.
Trait Implementations§
impl Copy for UmpPacket
impl Eq for UmpPacket
impl StructuralPartialEq for UmpPacket
Auto Trait Implementations§
impl Freeze for UmpPacket
impl RefUnwindSafe for UmpPacket
impl Send for UmpPacket
impl Sync for UmpPacket
impl Unpin for UmpPacket
impl UnsafeUnpin for UmpPacket
impl UnwindSafe for UmpPacket
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