pub struct Engine<P: Protocol> { /* private fields */ }Expand description
The engine: it runs a Protocol’s ops one step at a time, sans IO.
See the module’s documentation.
Implementations§
Source§impl<P: Protocol> Engine<P>
impl<P: Protocol> Engine<P>
Sourcepub fn poll_transmit(&mut self, now: Instant) -> Option<Vec<u8>>
pub fn poll_transmit(&mut self, now: Instant) -> Option<Vec<u8>>
Next message to send, if the line is free.
Sourcepub fn next_deadline(&self) -> Option<Instant>
pub fn next_deadline(&self) -> Option<Instant>
When the in-flight request stops waiting for its reply.
Sourcepub fn handle_timeout(&mut self, now: Instant)
pub fn handle_timeout(&mut self, now: Instant)
Fails the step in flight, and the rest of its op, if its timeout
passed by now.
Sourcepub fn handle_input(&mut self, bytes: &[u8])
pub fn handle_input(&mut self, bytes: &[u8])
Bytes from the synth, in fragments of any size. Each complete SysEx
message goes to Protocol::on_message.
Sourcepub fn poll_event(&mut self) -> Option<P::Event>
pub fn poll_event(&mut self) -> Option<P::Event>
The next event, in order.
Auto Trait Implementations§
impl<P> Freeze for Engine<P>
impl<P> RefUnwindSafe for Engine<P>where
P: RefUnwindSafe,
<P as Protocol>::Op: RefUnwindSafe,
<P as Protocol>::Expect: RefUnwindSafe,
<P as Protocol>::Event: RefUnwindSafe,
impl<P> Send for Engine<P>
impl<P> Sync for Engine<P>
impl<P> Unpin for Engine<P>
impl<P> UnsafeUnpin for Engine<P>
impl<P> UnwindSafe for Engine<P>where
P: UnwindSafe,
<P as Protocol>::Op: UnwindSafe,
<P as Protocol>::Expect: UnwindSafe,
<P as Protocol>::Event: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more