Skip to main content

StaticController

pub trait StaticController:
    Send
    + Sync
    + 'static {
    // Required methods
    fn decode<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Outcomes>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Readouts>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn decode_gadgets<'life0, 'async_trait>(
        &'life0 self,
        request: Request<Outcomes>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<BatchReadouts>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn reset<'life0, 'async_trait>(
        &'life0 self,
        request: Request<()>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with StaticControllerServer.

Required Methods§

Source

fn decode<'life0, 'async_trait>( &'life0 self, request: Request<Outcomes>, ) -> Pin<Box<dyn Future<Output = Result<Response<Readouts>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stream measurement outcomes (and optionally per-measurement loss flags) into the controller and return any decoded logical readouts that have become available. The bits in Outcomes.outcomes are accumulated across calls; when enough bits arrive to complete a gadget, that gadget is dispatched to the coordinator and its readouts are gathered. Callers stream the entire shot across one or more calls; the response carries readouts for every gadget that has finished by the time the final batch is received (the empty-readouts response of intermediate calls is also valid). The Outcomes.gid field is ignored by this controller — the static program determines gadget order — and modifiers is currently unused. loss_mask, when present, must have the same length as outcomes; it is forwarded verbatim to the coordinator (and on to the decoder) but not interpreted here. decoder_seed must remain unchanged across all calls for a shot. It is forwarded to every decoder request for that shot.

Source

fn decode_gadgets<'life0, 'async_trait>( &'life0 self, request: Request<Outcomes>, ) -> Pin<Box<dyn Future<Output = Result<Response<BatchReadouts>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Same input stream as Decode, but retain each gadget’s reply and statistics. Intermediate measurement batches return an empty list; the final batch returns every reply in program order, including zero-readout gadgets.

Source

fn reset<'life0, 'async_trait>( &'life0 self, request: Request<()>, ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

reset the system (but keep the loaded library)

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§