Struct Prepared UmpInput
pub struct PreparedUmpInput { /* private fields */ }Expand description
Unique prepared producer. Construction/drop belong outside callbacks. Capacity is 1..4096 packets. No allocation/locks/I/O on push; its native producer callback must obey single-producer ownership. No deadline guarantee.
Implementations§
§impl PreparedUmpInput
impl PreparedUmpInput
pub fn new(capacity: usize) -> Result<(Self, UmpReceiver), UmpInputError>
pub fn statistics(&self) -> MidiInputStatistics
pub fn try_push(&mut self, record: TimedUmp) -> Result<(), UmpInputError>
pub fn try_push(&mut self, record: TimedUmp) -> Result<(), UmpInputError>
Copies one framed packet. Accepted counts publication, not consumption; receiver abandonment can race the initial check. Rejected records remain caller-owned because TimedUmp is Copy. Counters wrap/coalesce relaxedly.
pub fn push_words(
&mut self,
timestamp: u64,
protocol: UmpProtocol,
words: &[u32],
) -> Result<UmpDelivery, UmpInputError>
pub fn push_words( &mut self, timestamp: u64, protocol: UmpProtocol, words: &[u32], ) -> Result<UmpDelivery, UmpInputError>
Preflight <=4096 numeric words at a known packet boundary. A malformed or oversized whole batch publishes nothing. All packets retain the supplied timestamp/protocol label. Framing accepts opaque/reserved message types; semantic/protocol conformance belongs to the native producer/consumer. Full/abandoned queues retain the accepted prefix and discard the suffix; dropped_full counts packets refused because full, invalid counts batches.