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§
Required Methods§
Sourcefn append(&mut self, rows: &[PatchRow]) -> Result<AppendResult, Self::Error>
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.
fn vector(&self, doc_id: &str) -> Result<Vec<(u64, u64)>, Self::Error>
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".