[][src]Enum dogear::MergeState

pub enum MergeState<'t> {
    LocalOnly(Node<'t>),
    RemoteOnly(Node<'t>),
    Local {
        local_node: Node<'t>,
        remote_node: Node<'t>,
    },
    Remote {
        local_node: Node<'t>,
        remote_node: Node<'t>,
    },
    RemoteOnlyWithNewStructure(Node<'t>),
    RemoteWithNewStructure {
        local_node: Node<'t>,
        remote_node: Node<'t>,
    },
    Unchanged {
        local_node: Node<'t>,
        remote_node: Node<'t>,
    },
}

The merge state indicates which node we should prefer, local or remote, when resolving conflicts.

Variants

LocalOnly(Node<'t>)

A local-only merge state means the item only exists locally, and should be uploaded.

RemoteOnly(Node<'t>)

A remote-only merge state means the item only exists remotely, and should be applied.

Local

A local merge state means the item exists on both sides, and has newer local changes that should be uploaded.

Fields of Local

local_node: Node<'t>remote_node: Node<'t>
Remote

A remote merge state means the item exists on both sides, and has newer remote changes that should be applied.

Fields of Remote

local_node: Node<'t>remote_node: Node<'t>
RemoteOnlyWithNewStructure(Node<'t>)

A remote-only merge state with new structure means the item only exists remotely, and has a new merged structure that should be reuploaded. We use new structure states to resolve conflicts caused by moving local items out of a remotely deleted folder, moving remote items out of a locally deleted folder, or merging divergent items.

RemoteWithNewStructure

A remote merge state with new structure means the item exists on both sides, has newer remote changes, and new structure that should be reuploaded.

Fields of RemoteWithNewStructure

local_node: Node<'t>remote_node: Node<'t>
Unchanged

An unchanged merge state means the item didn't change on either side, and doesn't need to be uploaded or applied.

Fields of Unchanged

local_node: Node<'t>remote_node: Node<'t>

Methods

impl<'t> MergeState<'t>[src]

pub fn local_node(&self) -> Option<&Node<'t>>[src]

Returns the local node for the item, or None if the item only exists remotely. The inverse of remote_node().

pub fn remote_node(&self) -> Option<&Node<'t>>[src]

Returns the remote node for the item, or None if the node only exists locally. The inverse of local_node().

pub fn should_apply(&self) -> bool[src]

Returns true if the remote item should be inserted into or updated in the local tree. This is not necessarily the inverse of should_upload(), as remote items with new structure should be both applied and reuploaded, and unchanged items should be neither.

pub fn upload_reason(&self) -> UploadReason[src]

Returns the reason for (re)uploading this node.

Trait Implementations

impl<'t> Copy for MergeState<'t>[src]

impl<'t> Clone for MergeState<'t>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'t> Debug for MergeState<'t>[src]

impl<'t> Display for MergeState<'t>[src]

Auto Trait Implementations

impl<'t> Send for MergeState<'t>

impl<'t> Sync for MergeState<'t>

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T> From<T> for 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<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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

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