pub struct RingMidiBuffer { /* private fields */ }Expand description
A fixed-capacity ring buffer of MidiEvents usable as both a
MidiSource and a MidiSink.
Writing to a full buffer evicts the oldest event and increments the dropped count; reading pops from the front.
Implementations§
Source§impl RingMidiBuffer
impl RingMidiBuffer
Sourcepub fn new(tpq: u32, capacity: usize) -> Result<Self, LiveMidiError>
pub fn new(tpq: u32, capacity: usize) -> Result<Self, LiveMidiError>
Creates a buffer at tpq resolution holding up to capacity events.
Fails with LiveMidiError::ZeroCapacity when capacity is zero.
Sourcepub fn dropped_events(&self) -> usize
pub fn dropped_events(&self) -> usize
Returns the running count of events dropped due to overflow.
Trait Implementations§
Source§impl Clone for RingMidiBuffer
impl Clone for RingMidiBuffer
Source§fn clone(&self) -> RingMidiBuffer
fn clone(&self) -> RingMidiBuffer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RingMidiBuffer
impl Debug for RingMidiBuffer
Source§impl MidiSink for RingMidiBuffer
impl MidiSink for RingMidiBuffer
Source§impl MidiSource for RingMidiBuffer
impl MidiSource for RingMidiBuffer
Auto Trait Implementations§
impl Freeze for RingMidiBuffer
impl RefUnwindSafe for RingMidiBuffer
impl Send for RingMidiBuffer
impl Sync for RingMidiBuffer
impl Unpin for RingMidiBuffer
impl UnsafeUnpin for RingMidiBuffer
impl UnwindSafe for RingMidiBuffer
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