Skip to main content

SyncTransport

Trait SyncTransport 

Source
pub trait SyncTransport {
    // Required methods
    fn publish(&self, ops: &[SyncOperation]) -> Result<(), String>;
    fn pull(&self, since: u64) -> Result<Vec<SyncOperation>, String>;
}
Expand description

Moves operations to/from a peer or relay. A dumb pipe — validation is the inbox’s job.

Required Methods§

Source

fn publish(&self, ops: &[SyncOperation]) -> Result<(), String>

Publish local operations to the relay/peer. Must be idempotent at the relay (dedup by operation id), so re-publishing a queued op is harmless.

Source

fn pull(&self, since: u64) -> Result<Vec<SyncOperation>, String>

Pull operations the relay holds after cursor since (0 = from the start). Returns them in relay order. Re-pulling is safe: the inbox dedups by operation id on admission.

Implementors§

Source§

impl SyncTransport for HttpRelayTransport

Available on non-WebAssembly only.
Source§

impl SyncTransport for InMemoryRelay

Source§

impl SyncTransport for Libp2pSyncTransport

Available on non-WebAssembly only.