Skip to main content

A2uiReplayBackbone

Trait A2uiReplayBackbone 

Source
pub trait A2uiReplayBackbone: Send + Sync {
    // Required methods
    fn publish(&self, run_id: &str, op: StatePatchOp);
    fn replay(&self, run_id: &str) -> Vec<StatePatchOp>;
}
Expand description

A durable-replay backbone for A2UI state patches, keyed by run_id. Distinct from RunManager’s live broadcast: this trait’s job is specifically “can a client that joins after some patches were already published still receive them,” which a tokio::sync::broadcast channel cannot do once its buffer has advanced past a slow/late subscriber.

Required Methods§

Source

fn publish(&self, run_id: &str, op: StatePatchOp)

Publishes a patch for run_id, retaining it for later replay.

Source

fn replay(&self, run_id: &str) -> Vec<StatePatchOp>

Returns every patch published for run_id so far, in publish order. A late-joining client calls this once on connect (its “reattach”), then switches to the live broadcast for anything published after.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§