CrdtField

Trait CrdtField 

Source
pub trait CrdtField:
    Clone
    + Send
    + Sync {
    // Required methods
    fn get_value(&self) -> Value;
    fn set_value(&mut self, value: Value) -> Result<(), BuilderError>;
    fn merge(&mut self, other: &Self) -> Result<(), BuilderError>;
    fn has_conflict(&self, other: &Self) -> bool;
    fn strategy(&self) -> CrdtStrategy;
}
Expand description

Trait for CRDT field operations

Required Methods§

Source

fn get_value(&self) -> Value

Get the field value

Source

fn set_value(&mut self, value: Value) -> Result<(), BuilderError>

Set the field value

Source

fn merge(&mut self, other: &Self) -> Result<(), BuilderError>

Merge with another field

Source

fn has_conflict(&self, other: &Self) -> bool

Check if there’s a conflict with another field

Source

fn strategy(&self) -> CrdtStrategy

Get the field strategy

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§