Skip to main content

PatchStore

Trait PatchStore 

Source
pub trait PatchStore {
    type Error: From<Error> + Into<Error>;

    // Required methods
    fn append(&mut self, rows: &[PatchRow]) -> Result<AppendResult, Self::Error>;
    fn vector(&self, doc_id: &str) -> Result<Vec<(u64, u64)>, Self::Error>;
    fn missing(
        &self,
        doc_id: &str,
        remote: &Vec<(u64, u64)>,
    ) -> Result<Vec<PatchRow>, Self::Error>;
    fn sync_state(
        &mut self,
        doc_id: &str,
        remote: &Vec<(u64, u64)>,
    ) -> Result<(Vec<PatchRow>, Vec<(u64, u64)>), Self::Error>;
}
Expand description

Immutable rows keyed by (doc_id, sid, clock). Rows stay pending until their actor prefix is contiguous and their dependencies are stored.

Required Associated Types§

Source

type Error: From<Error> + Into<Error>

Carries a Pulsify protocol error code, like Error.

Required Methods§

Source

fn append(&mut self, rows: &[PatchRow]) -> Result<AppendResult, Self::Error>

Validates and stores rows of one document atomically. Exact retransmissions are ignored; a conflict stores nothing.

Source

fn vector(&self, doc_id: &str) -> Result<Vec<(u64, u64)>, Self::Error>

Source

fn missing( &self, doc_id: &str, remote: &Vec<(u64, u64)>, ) -> Result<Vec<PatchRow>, Self::Error>

Ready rows the peer lacks, ordered by actor and clock.

Source

fn sync_state( &mut self, doc_id: &str, remote: &Vec<(u64, u64)>, ) -> Result<(Vec<PatchRow>, Vec<(u64, u64)>), Self::Error>

missing and vector from one consistent snapshot.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§