Skip to main content

DecoderClient

Trait DecoderClient 

Source
pub trait DecoderClient: Send {
    // Required methods
    async fn initialize(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>;
    async fn decode(
        &mut self,
        sample: &ErrorSet,
    ) -> Result<Vec<Readouts>, Box<dyn Error + Send + Sync>>;
    async fn reset(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>;
    fn simulator_name(&self) -> &'static str;

    // Provided method
    fn last_decode_latency_secs(&self) -> f64 { ... }
}
Expand description

Trait for decoder clients that can be used with the common simulation loop.

Required Methods§

Source

async fn initialize(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>

Initialize the client connection and any setup required before simulation.

Source

async fn decode( &mut self, sample: &ErrorSet, ) -> Result<Vec<Readouts>, Box<dyn Error + Send + Sync>>

Decode a sample and return each gadget’s readouts and statistics in program order.

Source

async fn reset(&mut self) -> Result<(), Box<dyn Error + Send + Sync>>

Reset the decoder state for the next shot.

Source

fn simulator_name(&self) -> &'static str

Get the name of the simulator for logging purposes.

Provided Methods§

Source

fn last_decode_latency_secs(&self) -> f64

Return the latency of the last decode batch (time from sending the final measurement batch to receiving readouts). For batch mode this equals the total decode time; for streaming mode it measures only the final blocking call. Returns 0.0 if not applicable.

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§