pub struct ConflictResolver { /* private fields */ }Expand description
Conflict resolution strategies for graph synchronization
Implementations§
Source§impl ConflictResolver
impl ConflictResolver
pub fn new(instance_id: String) -> ConflictResolver
Sourcepub fn resolve_node_conflict(
&self,
incoming: &SyncedNode,
our_node: Option<&SyncedNode>,
our_vector_clock: &mut VectorClock,
) -> Result<ConflictResolution, Error>
pub fn resolve_node_conflict( &self, incoming: &SyncedNode, our_node: Option<&SyncedNode>, our_vector_clock: &mut VectorClock, ) -> Result<ConflictResolution, Error>
Resolve a node conflict using vector clock merge and property reconciliation
Sourcepub fn resolve_edge_conflict(
&self,
incoming: &SyncedEdge,
our_edge: Option<&SyncedEdge>,
our_vector_clock: &mut VectorClock,
) -> Result<ConflictResolution, Error>
pub fn resolve_edge_conflict( &self, incoming: &SyncedEdge, our_edge: Option<&SyncedEdge>, our_vector_clock: &mut VectorClock, ) -> Result<ConflictResolution, Error>
Resolve an edge conflict
Sourcepub fn get_conflict_log(&self) -> Vec<ConflictRecord>
pub fn get_conflict_log(&self) -> Vec<ConflictRecord>
Get all recorded conflicts
Sourcepub fn clear_conflict_log(&self)
pub fn clear_conflict_log(&self)
Clear the conflict log
Sourcepub fn merge_json_properties(
&self,
local: &Value,
remote: &Value,
local_timestamp: DateTime<Utc>,
remote_timestamp: DateTime<Utc>,
) -> Value
pub fn merge_json_properties( &self, local: &Value, remote: &Value, local_timestamp: DateTime<Utc>, remote_timestamp: DateTime<Utc>, ) -> Value
Merge two JSON objects, preferring newer values based on timestamps
Sourcepub fn detect_semantic_conflicts(
&self,
local: &SyncedNode,
remote: &SyncedNode,
) -> Vec<String>
pub fn detect_semantic_conflicts( &self, local: &SyncedNode, remote: &SyncedNode, ) -> Vec<String>
Detect semantic conflicts (application-specific logic)
Auto Trait Implementations§
impl Freeze for ConflictResolver
impl RefUnwindSafe for ConflictResolver
impl Send for ConflictResolver
impl Sync for ConflictResolver
impl Unpin for ConflictResolver
impl UnwindSafe for ConflictResolver
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> 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