pub trait Simulator: Send {
// Required methods
fn handle(&mut self, msg: &[u8]) -> Vec<Vec<u8>>;
fn idle_tick(&mut self);
fn program(&self, slot: u16) -> Option<Vec<u8>>;
fn edit_buffer(&self) -> Vec<u8> ⓘ;
fn is_settled(&self) -> bool;
fn faults(&self) -> &'static [&'static str];
fn inject(&mut self, fault: &str);
}Expand description
A sans-IO simulated synth, for tests and demo mode.
Required Methods§
Sourcefn handle(&mut self, msg: &[u8]) -> Vec<Vec<u8>>
fn handle(&mut self, msg: &[u8]) -> Vec<Vec<u8>>
One complete SysEx message in, the replies out.
Sourcefn program(&self, slot: u16) -> Option<Vec<u8>>
fn program(&self, slot: u16) -> Option<Vec<u8>>
The program in slot, or None for a slot the synth does not have.
Sourcefn edit_buffer(&self) -> Vec<u8> ⓘ
fn edit_buffer(&self) -> Vec<u8> ⓘ
The edit buffer’s program.
Sourcefn is_settled(&self) -> bool
fn is_settled(&self) -> bool
No pending save and no corrupted reply state.
Sourcefn faults(&self) -> &'static [&'static str]
fn faults(&self) -> &'static [&'static str]
Failures seen on hardware that Simulator::inject can switch on.
Sourcefn inject(&mut self, fault: &str)
fn inject(&mut self, fault: &str)
Switches on fault, one of Simulator::faults, until the
simulator is dropped.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".