[][src]Trait dogear::Store

pub trait Store {
    type Ok;
    type Error: From<Error>;
    fn fetch_local_tree(&self) -> Result<Tree, Self::Error>;
fn fetch_remote_tree(&self) -> Result<Tree, Self::Error>;
fn apply<'t>(
        &mut self,
        root: MergedRoot<'t>
    ) -> Result<Self::Ok, Self::Error>; fn merge(&mut self) -> Result<Self::Ok, Self::Error> { ... }
fn merge_with_driver(
        &mut self,
        driver: &impl Driver,
        signal: &impl AbortSignal
    ) -> Result<Self::Ok, Self::Error> { ... } }

A store is the main interface to Dogear. It implements methods for building local and remote trees from a storage backend, fetching content info for matching items with similar contents, and persisting the merged tree.

Associated Types

type Ok

The type returned from a successful merge.

type Error: From<Error>

The type returned in the event of a store error.

Loading content...

Required methods

fn fetch_local_tree(&self) -> Result<Tree, Self::Error>

Builds a fully rooted, consistent tree from the items and tombstones in the local store.

fn fetch_remote_tree(&self) -> Result<Tree, Self::Error>

Builds a fully rooted, consistent tree from the items and tombstones in the mirror.

fn apply<'t>(&mut self, root: MergedRoot<'t>) -> Result<Self::Ok, Self::Error>

Applies the merged root to the local store, and stages items for upload. On Desktop, this method inserts the merged tree into a temp table, updates Places, and inserts outgoing items into another temp table.

Loading content...

Provided methods

fn merge(&mut self) -> Result<Self::Ok, Self::Error>

Builds and applies a merged tree using the default merge driver.

fn merge_with_driver(
    &mut self,
    driver: &impl Driver,
    signal: &impl AbortSignal
) -> Result<Self::Ok, Self::Error>

Builds a complete merged tree from the local and remote trees, resolves conflicts, dedupes local items, and applies the merged tree using the given driver.

Loading content...

Implementors

Loading content...