pub trait Data<B: Buffer> {
// Required method
fn data(&self) -> &[B::Unit];
}
Expand description
View the wrapped data of the MIDI message as a slice of units.
A slice of u32 for Ump backed messages.
use midi2::{Data, channel_voice1::NoteOn};
let message = NoteOn::<[u32; 4]>::new();
assert_eq!(message.data(), &[0x2090_0000]);
A slice of u8 for Bytes backed messages.
use midi2::{Data, channel_voice1::NoteOn};
let message = NoteOn::<[u8; 3]>::new();
assert_eq!(message.data(), &[0x90, 0x00, 0x00]);