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<VersionVector, Self::Error>;
fn missing(
&self,
doc_id: &str,
remote: &VersionVector,
) -> Result<Vec<PatchRow>, Self::Error>;
fn sync_state(
&mut self,
doc_id: &str,
remote: &VersionVector,
) -> Result<(Vec<PatchRow>, VersionVector), 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<VersionVector, Self::Error>
Sourcefn missing(
&self,
doc_id: &str,
remote: &VersionVector,
) -> Result<Vec<PatchRow>, Self::Error>
fn missing( &self, doc_id: &str, remote: &VersionVector, ) -> Result<Vec<PatchRow>, Self::Error>
Ready rows the peer lacks, ordered by actor and clock.
Sourcefn sync_state(
&mut self,
doc_id: &str,
remote: &VersionVector,
) -> Result<(Vec<PatchRow>, VersionVector), Self::Error>
fn sync_state( &mut self, doc_id: &str, remote: &VersionVector, ) -> Result<(Vec<PatchRow>, VersionVector), 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".