Struct UmpPacket
pub struct UmpPacket { /* private fields */ }Expand description
One complete Universal MIDI Packet, retaining every bit including reserved data.
This validates framing only, not message semantics or negotiated protocol. Words are numeric values; transport byte order must be selected explicitly.
Implementations§
§impl UmpPacket
impl UmpPacket
pub const fn word_count(first: u32) -> usize
pub const fn word_count(first: u32) -> usize
Required word count for a first word, including reserved message types.
pub fn from_words(words: &[u32]) -> Result<Self, UmpError>
pub fn from_words(words: &[u32]) -> Result<Self, UmpError>
Copies exactly one complete packet. No allocation or partial acceptance.
pub fn from_be_bytes(bytes: &[u8]) -> Result<Self, UmpError>
pub fn from_be_bytes(bytes: &[u8]) -> Result<Self, UmpError>
Reads an explicitly big-endian byte representation of one packet. This is an application serialization choice, not a universal UMP transport.
pub fn write_be_bytes(self, output: &mut [u8]) -> Result<usize, UmpError>
pub fn write_be_bytes(self, output: &mut [u8]) -> Result<usize, UmpError>
Writes complete big-endian words, preserving destination tails. An undersized destination is unchanged.
pub const fn message_type(self) -> u8
pub const fn message_type(self) -> u8
Four-bit message type.
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§
§impl<T> BorrowMut<T> for T
impl<T> BorrowMut<T> for T
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more