pub struct Client<T> { /* private fields */ }Expand description
A transport-independent MIDI controller and graph-discovery client.
Implementations§
Source§impl<T: Transport> Client<T>
impl<T: Transport> Client<T>
Sourcepub fn new(transport: T) -> Self
pub fn new(transport: T) -> Self
Start a client with a randomized request-ID seed for reply correlation. Request IDs are not authentication credentials.
Sourcepub fn into_transport(self) -> T
pub fn into_transport(self) -> T
Return the owned transport.
Sourcepub fn send(&mut self, command: MidiCommand) -> Result<()>
pub fn send(&mut self, command: MidiCommand) -> Result<()>
Send an ordinary MIDI command, validating data bytes before transmission.
This confirms transport submission only. It does not wait for audio application, and ordinary MIDI commands have no remote completion receipt.
§Errors
Returns an error for invalid MIDI values or a failed transport send.
Sourcepub fn graph(&mut self, timeout: Duration) -> Result<Graph>
pub fn graph(&mut self, timeout: Duration) -> Result<Graph>
Query a complete, coherent graph snapshot within a total time budget.
Unrelated MIDI and replies to other requests are ignored. Missing, duplicated, out-of-order and malformed records fail the whole query. Every call starts fresh; a failed snapshot never replaces a caller’s graph.
§Errors
Returns TimedOut when no complete snapshot arrives (including firmware
without this protocol), a target rejection, or invalid-data/transport errors.