[−][src]Enum dogear::MergeState
The merge state indicates which side 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.
LocalOnlyWithNewLocalStructure(Node<'t>)
Local-only with a new local structure means the item should be uploaded, and has new children (reparented or repositioned) locally.
RemoteOnly(Node<'t>)
A remote-only merge state means the item only exists remotely, and should be applied.
RemoteOnlyWithNewRemoteStructure(Node<'t>)
Remote-only with a new remote structure means the item should be applied, and has a new child list that should be uploaded.
Local
A local merge state means the item exists on both sides, and has newer local changes that should be uploaded.
Fields of Local
LocalWithNewLocalStructure
Local with a new local structure means the item has newer local changes that should be uploaded, and new children locally.
Fields of LocalWithNewLocalStructure
Remote
A remote merge state means the item exists on both sides, and has newer remote changes that should be applied.
Fields of Remote
RemoteWithNewRemoteStructure
Remote with a new remote structure means the item has newer remote changes that should be applied, and a new child list that should be uploaded.
Fields of RemoteWithNewRemoteStructure
Unchanged
An unchanged merge state means the item and its children are the same on both sides, and don't need to be uploaded or applied.
Fields of Unchanged
UnchangedWithNewLocalStructure
Unchanged with a new local structure means the item hasn't changed, but its children have. The new children should be applied locally, but not uploaded.
Fields of UnchangedWithNewLocalStructure
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_item(&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 should_apply_structure(&self) -> bool
[src]
Returns true
if the item has a new structure (parent or children)
that should be updated in the local tree.
pub fn should_upload(&self) -> bool
[src]
Returns true
if the item should be flagged for (re)upload.
pub fn with_new_local_structure(self) -> MergeState<'t>
[src]
Returns a new merge state, indicating that the item has a new merged structure that should be applied locally.
pub fn with_new_remote_structure(self) -> MergeState<'t>
[src]
Returns a new merge state, indicating that the item has a new merged structure that should be reuploaded to the server.
Trait Implementations
impl<'t> Clone for MergeState<'t>
[src]
fn clone(&self) -> MergeState<'t>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'t> Copy for MergeState<'t>
[src]
impl<'t> Debug for MergeState<'t>
[src]
impl<'t> Display for MergeState<'t>
[src]
Auto Trait Implementations
impl<'t> Unpin for MergeState<'t>
impl<'t> Sync for MergeState<'t>
impl<'t> Send for MergeState<'t>
impl<'t> UnwindSafe for MergeState<'t>
impl<'t> RefUnwindSafe for MergeState<'t>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,