pub struct Conflict {
pub path: PathBuf,
pub base: PathOperation,
pub incoming: PathOperation,
}Expand description
A detected conflict between two operations on the same path
Fields§
§path: PathBufThe path where the conflict occurred
base: PathOperationThe local (base) operation
incoming: PathOperationThe incoming (remote) operation
Implementations§
Source§impl Conflict
impl Conflict
Sourcepub fn new(path: PathBuf, base: PathOperation, incoming: PathOperation) -> Self
pub fn new(path: PathBuf, base: PathOperation, incoming: PathOperation) -> Self
Create a new conflict
Sourcepub fn is_concurrent(&self) -> bool
pub fn is_concurrent(&self) -> bool
Check if both operations have the same timestamp (true concurrent edit)
Sourcepub fn crdt_winner(&self) -> &PathOperation
pub fn crdt_winner(&self) -> &PathOperation
Get the operation with the higher OpId (the “winner” by default CRDT rules)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Conflict
impl RefUnwindSafe for Conflict
impl Send for Conflict
impl Sync for Conflict
impl Unpin for Conflict
impl UnwindSafe for Conflict
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more