refactor sync to new model

This commit is contained in:
Dustin J. Mitchell
2020-11-25 17:52:47 -05:00
parent e92fc0628b
commit a81c84d7c7
8 changed files with 193 additions and 143 deletions

View File

@@ -23,6 +23,12 @@ fn taskmap_with(mut properties: Vec<(String, String)>) -> TaskMap {
rv
}
/// The type of VersionIds
pub use crate::server::VersionId;
/// The default for base_version.
pub(crate) const DEFAULT_BASE_VERSION: Uuid = crate::server::NO_VERSION_ID;
/// A TaskStorage transaction, in which storage operations are performed.
///
/// # Concurrency
@@ -58,10 +64,10 @@ pub trait TaskStorageTxn {
fn all_task_uuids(&mut self) -> Fallible<Vec<Uuid>>;
/// Get the current base_version for this storage -- the last version synced from the server.
fn base_version(&mut self) -> Fallible<u64>;
fn base_version(&mut self) -> Fallible<VersionId>;
/// Set the current base_version for this storage.
fn set_base_version(&mut self, version: u64) -> Fallible<()>;
fn set_base_version(&mut self, version: VersionId) -> Fallible<()>;
/// Get the current set of outstanding operations (operations that have not been sync'd to the
/// server yet)