pub trait Link: Send {
// Required methods
fn send(&mut self, bytes: &[u8]) -> Result<(), Error>;
fn recv_until(
&mut self,
deadline: Instant,
) -> Result<Option<Vec<u8>>, Error>;
// Provided methods
fn ring_on_input(&mut self, _bell: Sender<()>) { ... }
fn synchronous(&self) -> bool { ... }
}Expand description
A bidirectional SysEx connection to a synth.
Required Methods§
Provided Methods§
Sourcefn ring_on_input(&mut self, _bell: Sender<()>)
fn ring_on_input(&mut self, _bell: Sender<()>)
Send () on bell after input arrives (the input first), so one
thread can wait on several links. A link whose input arrives on its
own (not Link::synchronous) must implement it.
Sourcefn synchronous(&self) -> bool
fn synchronous(&self) -> bool
True when input only ever arrives during a send (a simulator): all of it is there once the send returns, so a deadline passes at once instead of being waited for.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".