Struct reaper_medium::LongMidiEvent
source · [−]#[repr(C)]pub struct LongMidiEvent { /* private fields */ }
Expand description
An owned MIDI event which can hold more than just the usual 3-byte short MIDI message.
Has exactly the same layout as MidiEvent
but reserves much more space
for the message.
Implementations
sourceimpl LongMidiEvent
impl LongMidiEvent
sourcepub const MAX_LENGTH: usize = 256usize
pub const MAX_LENGTH: usize = 256usize
The maximum message length.
sourcepub fn new(
frame_offset: MidiFrameOffset,
midi_message: [u8; 256],
size: u32
) -> Self
pub fn new(
frame_offset: MidiFrameOffset,
midi_message: [u8; 256],
size: u32
) -> Self
Creates a long MIDI event directly from an owned byte array.
Size needs to be given because the actual message length is probably lower than the maximum size of a long message.
sourcepub fn try_from_slice(
frame_offset: MidiFrameOffset,
midi_message: &[u8]
) -> Result<Self, &'static str>
pub fn try_from_slice(
frame_offset: MidiFrameOffset,
midi_message: &[u8]
) -> Result<Self, &'static str>
Attempts to create a long MIDI event from the given slice.
Involves copying.
Errors
Returns an error if the given slice is longer than the supported maximum.
Trait Implementations
sourceimpl AsRef<MIDI_event_t> for LongMidiEvent
impl AsRef<MIDI_event_t> for LongMidiEvent
sourcefn as_ref(&self) -> &MIDI_event_t
fn as_ref(&self) -> &MIDI_event_t
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Clone for LongMidiEvent
impl Clone for LongMidiEvent
sourcefn clone(&self) -> LongMidiEvent
fn clone(&self) -> LongMidiEvent
Returns a copy of the value. Read more
1.0.0 · sourceconst fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresourceimpl Debug for LongMidiEvent
impl Debug for LongMidiEvent
sourceimpl Hash for LongMidiEvent
impl Hash for LongMidiEvent
sourceimpl PartialEq<LongMidiEvent> for LongMidiEvent
impl PartialEq<LongMidiEvent> for LongMidiEvent
sourcefn eq(&self, other: &LongMidiEvent) -> bool
fn eq(&self, other: &LongMidiEvent) -> bool
impl Copy for LongMidiEvent
impl Eq for LongMidiEvent
impl StructuralEq for LongMidiEvent
impl StructuralPartialEq for LongMidiEvent
Auto Trait Implementations
impl RefUnwindSafe for LongMidiEvent
impl Send for LongMidiEvent
impl Sync for LongMidiEvent
impl Unpin for LongMidiEvent
impl UnwindSafe for LongMidiEvent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
sourcefn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
fn into_any(self: Box<T, Global>) -> Box<dyn Any + 'static, Global>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any + 'static>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
. Read moresourcefn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s. Read moresourcefn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s. Read more