Skip to main content

Protocol

Trait Protocol 

Source
pub trait Protocol {
    type Op;
    type Event;
    type Expect: Copy;

    // Required methods
    fn expand(&self, op: Self::Op) -> Vec<Step<Self::Expect>>;
    fn on_message(
        &self,
        msg: &[u8],
        expect: Self::Expect,
        what: &'static str,
        index: Option<u16>,
    ) -> Outcome<Self::Event>;
    fn progress(done: usize, total: usize) -> Self::Event;
    fn done() -> Self::Event;
    fn failed(e: OpError) -> Self::Event;
}
Expand description

A synth’s request/reply rules.

Required Associated Types§

Source

type Op

An operation that a caller submits.

Source

type Event

A result that the engine reports.

Source

type Expect: Copy

What a step waits for; see Step::expect.

Required Methods§

Source

fn expand(&self, op: Self::Op) -> Vec<Step<Self::Expect>>

The steps that make up op, in the order the engine sends them.

Source

fn on_message( &self, msg: &[u8], expect: Self::Expect, what: &'static str, index: Option<u16>, ) -> Outcome<Self::Event>

Classify one complete SysEx message against the step in flight.

Source

fn progress(done: usize, total: usize) -> Self::Event

The event for done steps of total done.

Source

fn done() -> Self::Event

The event for an op whose every step succeeded.

Source

fn failed(e: OpError) -> Self::Event

The event for an op that failed with e.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§