Skip to main content

SqliteSyncWork

Struct SqliteSyncWork 

Source
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<'_>

Source

pub fn append( &mut self, payload: &[u8], sequence: u64, ) -> SqliteSyncResult<usize>

Appends an opaque record. Identical positive sequence replay is a no-op.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn put_object_v1( &mut self, object: &OpaqueObjectV1, mutation_id: &str, expected: ObjectRevisionV1, ) -> SqliteSyncResult<ObjectWriteResultV1>

Mutates a canonical opaque object atomically with this work’s sync operations. Exact mutation replay returns its original revision without replacing later data. Reusing an identity with different bytes fails. Propagate every returned error.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for SqliteSyncWork<'a>

§

impl<'a> !Send for SqliteSyncWork<'a>

§

impl<'a> !Sync for SqliteSyncWork<'a>

§

impl<'a> !UnwindSafe for SqliteSyncWork<'a>

§

impl<'a> Forget for SqliteSyncWork<'a>

§

impl<'a> Freeze for SqliteSyncWork<'a>

§

impl<'a> Move for SqliteSyncWork<'a>

§

impl<'a> Unpin for SqliteSyncWork<'a>

§

impl<'a> UnsafeUnpin for SqliteSyncWork<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V