Skip to main content

Link

Trait Link 

Source
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§

Source

fn send(&mut self, bytes: &[u8]) -> Result<(), Error>

Send complete messages (one or more SysEx messages back to back).

Source

fn recv_until(&mut self, deadline: Instant) -> Result<Option<Vec<u8>>, Error>

Next complete SysEx message, or None when none arrives by deadline.

Provided Methods§

Source

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.

Source

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".

Implementors§