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§