pub struct SqliteSyncWork<'a> { /* private fields */ }Expand description
Bounded provider-owned unit of work; never exposes SQL or a connection. Callbacks must be short and must not reenter this store or wait for network I/O. Filesystem writes are outside this transaction and require a recovery journal.
Implementations§
Source§impl SqliteSyncWork<'_>
impl SqliteSyncWork<'_>
Sourcepub fn append(
&mut self,
payload: &[u8],
sequence: u64,
) -> SqliteSyncResult<usize>
pub fn append( &mut self, payload: &[u8], sequence: u64, ) -> SqliteSyncResult<usize>
Appends an opaque record. Identical positive sequence replay is a no-op.
Sourcepub fn enqueue(&mut self, message: &SyncMessage) -> SqliteSyncResult<bool>
pub fn enqueue(&mut self, message: &SyncMessage) -> SqliteSyncResult<bool>
Enqueues one bounded message. Identical pending replay returns false; a full queue returns an error, ensuring the whole unit of work rolls back.
Sourcepub fn checkpoint(
&mut self,
peer: &str,
sequence: u64,
hash: &str,
observed_head: u64,
) -> SqliteSyncResult<()>
pub fn checkpoint( &mut self, peer: &str, sequence: u64, hash: &str, observed_head: u64, ) -> SqliteSyncResult<()>
Advances a checkpoint only within an authenticated observed history head. Head authenticity and materialization are the caller’s responsibility.
Sourcepub fn stage_object_write(
&mut self,
intent: &ObjectWriteIntentV1,
) -> SqliteSyncResult<bool>
pub fn stage_object_write( &mut self, intent: &ObjectWriteIntentV1, ) -> SqliteSyncResult<bool>
Journals opaque bytes before filesystem publication in the same transaction as enqueue/log/checkpoint. Replay materializes committed intents only.
Sourcepub fn acknowledge(
&mut self,
receipt: &SyncOutboxReceipt,
) -> SqliteSyncResult<usize>
pub fn acknowledge( &mut self, receipt: &SyncOutboxReceipt, ) -> SqliteSyncResult<usize>
Applies an exact ordered outbox receipt in this transaction, so checkpoint advancement and acknowledgement may share one commit boundary.