pub trait SyncStorage: Send + Sync {
// Required methods
fn add_outgoing_change<'life0, 'async_trait>(
&'life0 self,
record: UnversionedRecordChange,
) -> Pin<Box<dyn Future<Output = Result<u64, SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn complete_outgoing_sync<'life0, 'async_trait>(
&'life0 self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_pending_outgoing_changes<'life0, 'async_trait>(
&'life0 self,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<OutgoingChange>, SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_last_revision<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn insert_incoming_records<'life0, 'async_trait>(
&'life0 self,
records: Vec<Record>,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn delete_incoming_record<'life0, 'async_trait>(
&'life0 self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn rebase_pending_outgoing_records<'life0, 'async_trait>(
&'life0 self,
revision: u64,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_incoming_records<'life0, 'async_trait>(
&'life0 self,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<IncomingChange>, SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn get_latest_outgoing_change<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<OutgoingChange>, SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn update_record_from_incoming<'life0, 'async_trait>(
&'life0 self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
}Required Methods§
fn add_outgoing_change<'life0, 'async_trait>(
&'life0 self,
record: UnversionedRecordChange,
) -> Pin<Box<dyn Future<Output = Result<u64, SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn complete_outgoing_sync<'life0, 'async_trait>(
&'life0 self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pending_outgoing_changes<'life0, 'async_trait>(
&'life0 self,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<OutgoingChange>, SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sourcefn get_last_revision<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_last_revision<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<u64, SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the revision number of the last synchronized record
Sourcefn insert_incoming_records<'life0, 'async_trait>(
&'life0 self,
records: Vec<Record>,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn insert_incoming_records<'life0, 'async_trait>(
&'life0 self,
records: Vec<Record>,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Insert incoming records from remote sync
Sourcefn delete_incoming_record<'life0, 'async_trait>(
&'life0 self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_incoming_record<'life0, 'async_trait>(
&'life0 self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Delete an incoming record after it has been processed
Sourcefn rebase_pending_outgoing_records<'life0, 'async_trait>(
&'life0 self,
revision: u64,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn rebase_pending_outgoing_records<'life0, 'async_trait>(
&'life0 self,
revision: u64,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update revision numbers of pending outgoing records to be higher than the given revision
Sourcefn get_incoming_records<'life0, 'async_trait>(
&'life0 self,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<IncomingChange>, SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_incoming_records<'life0, 'async_trait>(
&'life0 self,
limit: u32,
) -> Pin<Box<dyn Future<Output = Result<Vec<IncomingChange>, SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get incoming records that need to be processed, up to the specified limit
Sourcefn get_latest_outgoing_change<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<OutgoingChange>, SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_latest_outgoing_change<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<OutgoingChange>, SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get the latest outgoing record if any exists
Sourcefn update_record_from_incoming<'life0, 'async_trait>(
&'life0 self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn update_record_from_incoming<'life0, 'async_trait>(
&'life0 self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<(), SyncStorageError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Update the sync state record from an incoming record