[][src]Struct places::bookmark_sync::store::BookmarksStore

pub struct BookmarksStore<'a> {
    pub db: &'a PlacesDb,
    interruptee: &'a SqlInterruptScope,
}

Fields

db: &'a PlacesDbinterruptee: &'a SqlInterruptScope

Implementations

impl<'a> BookmarksStore<'a>[src]

pub fn new(db: &'a PlacesDb, interruptee: &'a SqlInterruptScope) -> Self[src]

fn stage_incoming(
    &self,
    inbound: IncomingChangeset,
    incoming_telemetry: &mut EngineIncoming
) -> Result<ServerTimestamp>
[src]

fn has_changes(&self) -> Result<bool>[src]

fn update_local_items_in_places<'t>(
    &self,
    now: Timestamp,
    ops: &CompletionOps<'t>
) -> Result<()>
[src]

Builds a temporary table with the merge states of all nodes in the merged tree, then updates the local tree to match the merged tree.

Conceptually, we examine the merge state of each item, and either leave the item unchanged, upload the local side, apply the remote side, or apply and then reupload the remote side with a new structure.

fn apply_remote_items(&self, now: Timestamp) -> Result<()>[src]

fn stage_items_to_upload(
    &self,
    upload_items: &[UploadItem<'_>],
    upload_tombstones: &[UploadTombstone<'_>]
) -> Result<()>
[src]

Stores a snapshot of all locally changed items in a temporary table for upload. This is called from within the merge transaction, to ensure that changes made during the sync don't cause us to upload inconsistent records.

Conceptually, itemsToUpload is a transient "view" of locally changed items. The local change counter is the persistent record of items that we need to upload, so, if upload is interrupted or fails, we'll stage the items again on the next sync.

fn fetch_outgoing_records(
    &self,
    timestamp: ServerTimestamp
) -> Result<OutgoingChangeset>
[src]

Inflates Sync records for all staged outgoing items.

fn push_synced_items(
    &self,
    uploaded_at: ServerTimestamp,
    records_synced: Vec<SyncGuid>
) -> Result<()>
[src]

Decrements the change counter, updates the sync status, and cleans up tombstones for successfully synced items. Sync calls this method at the end of each bookmark sync.

pub(crate) fn update_frecencies(&self) -> Result<()>[src]

Trait Implementations

impl<'a> Store for BookmarksStore<'a>[src]

fn wipe(&self) -> Result<()>[src]

Erases all local items. Unlike reset, this keeps all synced items until the next sync, when they will be replaced with tombstones. This also preserves the sync ID and last sync time.

Conceptually, the next sync will merge an empty local tree, and a full remote tree.

Auto Trait Implementations

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

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

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

impl<'a> Unpin for BookmarksStore<'a>

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

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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