pub trait FromUmp<T>: Sized {
// Required method
fn from_ump(other: T) -> Self;
}
Expand description
Convert a message from a Ump backing buffer to a Bytes backing buffer.
Note that in most cases this is a “lossy” conversion. Some
fields in a Ump message are not represented in a Bytes
message like group
, for example.
use midi2::{FromUmp, Data, channel_voice1::NoteOn};
let ump_message = NoteOn::try_from(&[0x279E_753D_u32][..]).expect("Valid data");
let bytes_message = NoteOn::<[u8; 3]>::from_ump(ump_message);
assert_eq!(bytes_message.data(), &[0x9E, 0x75, 0x3D]);
Required Methods§
Object Safety§
This trait is not object safe.