pub struct Midi<'a> { /* private fields */ }Implementations§
Source§impl<'a> Midi<'a>
impl<'a> Midi<'a>
Sourcepub const unsafe fn new_unchecked(header: &'a Header) -> Self
pub const unsafe fn new_unchecked(header: &'a Header) -> Self
§Safety
The header must be a header of type: clap_event_midi.
pub const fn port_index(&self) -> u16
pub const fn data(&self) -> &[u8; 3]
Sourcepub const fn build() -> MidiBuilder
pub const fn build() -> MidiBuilder
§Example
let midi = Midi::build().port_index(1).time(3);
let event = midi.event();
assert_eq!(event.port_index(), 1);
assert_eq!(event.header().time(), 3);Sourcepub fn update(&self) -> MidiBuilder
pub fn update(&self) -> MidiBuilder
§Example
let midi = Midi::build().port_index(1).data([1, 2, 3]);
let event = midi.event();
let other_midi = event.update().data([4, 5, 6]);
let other_event = other_midi.event();
assert_eq!(event.port_index(), 1);
assert_eq!(event.data(), &[1, 2, 3]);
assert_eq!(other_event.port_index(), 1);
assert_eq!(other_event.data(), &[4, 5, 6]);Trait Implementations§
impl<'a> Copy for Midi<'a>
impl<'a> StructuralPartialEq for Midi<'a>
Auto Trait Implementations§
impl<'a> Freeze for Midi<'a>
impl<'a> RefUnwindSafe for Midi<'a>
impl<'a> Send for Midi<'a>
impl<'a> Sync for Midi<'a>
impl<'a> Unpin for Midi<'a>
impl<'a> UnwindSafe for Midi<'a>
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