pub trait DriverSession: Send {
// Required methods
fn submit(&mut self, op: SessionOp) -> Result<(), DriverError>;
fn is_idle(&self) -> bool;
fn poll_transmit(&mut self, now: Instant) -> Option<Vec<u8>>;
fn next_deadline(&self) -> Option<Instant>;
fn handle_timeout(&mut self, now: Instant);
fn handle_input(&mut self, bytes: &[u8]);
fn poll_event(&mut self) -> Option<SessionEvent>;
}Expand description
A sans-IO session with one connected synth.
Required Methods§
Sourcefn submit(&mut self, op: SessionOp) -> Result<(), DriverError>
fn submit(&mut self, op: SessionOp) -> Result<(), DriverError>
Plans the op. Errors before anything is queued: a bad slot, a write to a factory slot, or a bad program sends nothing.
Sourcefn poll_transmit(&mut self, now: Instant) -> Option<Vec<u8>>
fn poll_transmit(&mut self, now: Instant) -> Option<Vec<u8>>
The next bytes to send to the synth, if the session sends now.
Sourcefn next_deadline(&self) -> Option<Instant>
fn next_deadline(&self) -> Option<Instant>
When the caller must call DriverSession::handle_timeout, if a
request waits for its reply.
Sourcefn handle_timeout(&mut self, now: Instant)
fn handle_timeout(&mut self, now: Instant)
Time passed: a request whose reply did not come by now fails.
Sourcefn handle_input(&mut self, bytes: &[u8])
fn handle_input(&mut self, bytes: &[u8])
Bytes that the synth sent, in fragments of any size.
Sourcefn poll_event(&mut self) -> Option<SessionEvent>
fn poll_event(&mut self) -> Option<SessionEvent>
The next result of the submitted ops, in order.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".