pub struct SyncFunctions { /* private fields */ }Expand description
Sync’s computations of the sync state from its facts (SyncFacts) and of
an upload’s phase from its own (UploadPhaseFacts), which the database
registers as _coven_sync_state and _coven_upload_phase. Clones share
them.
Implementations§
Source§impl SyncFunctions
impl SyncFunctions
Sourcepub fn new<P: PendingValue + Clone>(
state: fn(SyncFacts<P>) -> Result<SyncStateRow, DbError>,
upload_phase: fn(UploadPhaseFacts<P>) -> Result<UploadPhaseRow, DbError>,
) -> Self
pub fn new<P: PendingValue + Clone>( state: fn(SyncFacts<P>) -> Result<SyncStateRow, DbError>, upload_phase: fn(UploadPhaseFacts<P>) -> Result<UploadPhaseRow, DbError>, ) -> Self
The functions that decode their arguments as the facts, with the
pending records as P, and compute the state with state and an
upload’s phase with upload_phase. Each computation must read only
its facts and return at once: SQLite calls it inside a read, and coven
runs a live query again only when a table the query reads changes.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for SyncFunctions
impl !UnwindSafe for SyncFunctions
impl Freeze for SyncFunctions
impl Send for SyncFunctions
impl Sync for SyncFunctions
impl Unpin for SyncFunctions
impl UnsafeUnpin for SyncFunctions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more