autofill::sync

Trait ProcessIncomingRecordImpl

source
pub trait ProcessIncomingRecordImpl {
    type Record;

    // Required methods
    fn stage_incoming(
        &self,
        tx: &Transaction<'_>,
        incoming: Vec<IncomingBso>,
        signal: &dyn Interruptee,
    ) -> Result<()>;
    fn finish_incoming(&self, tx: &Transaction<'_>) -> Result<()>;
    fn fetch_incoming_states(
        &self,
        tx: &Transaction<'_>,
    ) -> Result<Vec<IncomingState<Self::Record>>>;
    fn get_local_dupe(
        &self,
        tx: &Transaction<'_>,
        incoming: &Self::Record,
    ) -> Result<Option<Self::Record>>;
    fn update_local_record(
        &self,
        tx: &Transaction<'_>,
        record: Self::Record,
        was_merged: bool,
    ) -> Result<()>;
    fn insert_local_record(
        &self,
        tx: &Transaction<'_>,
        record: Self::Record,
    ) -> Result<()>;
    fn change_record_guid(
        &self,
        tx: &Transaction<'_>,
        old_guid: &Guid,
        new_guid: &Guid,
    ) -> Result<()>;
    fn remove_record(&self, tx: &Transaction<'_>, guid: &Guid) -> Result<()>;
    fn remove_tombstone(&self, tx: &Transaction<'_>, guid: &Guid) -> Result<()>;
}

Required Associated Types§

Required Methods§

source

fn stage_incoming( &self, tx: &Transaction<'_>, incoming: Vec<IncomingBso>, signal: &dyn Interruptee, ) -> Result<()>

source

fn finish_incoming(&self, tx: &Transaction<'_>) -> Result<()>

Finish the incoming phase. This will typically caused staged records

source

fn fetch_incoming_states( &self, tx: &Transaction<'_>, ) -> Result<Vec<IncomingState<Self::Record>>>

source

fn get_local_dupe( &self, tx: &Transaction<'_>, incoming: &Self::Record, ) -> Result<Option<Self::Record>>

Returns a local record that has the same values as the given incoming record (with the exception of the guid values which should differ) that will be used as a local duplicate record for syncing.

source

fn update_local_record( &self, tx: &Transaction<'_>, record: Self::Record, was_merged: bool, ) -> Result<()>

source

fn insert_local_record( &self, tx: &Transaction<'_>, record: Self::Record, ) -> Result<()>

source

fn change_record_guid( &self, tx: &Transaction<'_>, old_guid: &Guid, new_guid: &Guid, ) -> Result<()>

source

fn remove_record(&self, tx: &Transaction<'_>, guid: &Guid) -> Result<()>

source

fn remove_tombstone(&self, tx: &Transaction<'_>, guid: &Guid) -> Result<()>

Implementors§