1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/// Describes the result of an update operation performed on a `DittoMutDocument`.
///
/// - set: Describes the `set` update that was performed.
/// - removed: Describes the `remove` update that was performed.
/// - incremented: Describes the `increment` update that was performed.
pub struct UpdateResult {
    pub op: UpdateOp,
    pub doc_id: String,
    pub path: String,
    pub value: Box<dyn std::fmt::Debug>, // we only care if we can print the value
}

/// Update operation performed on a `DittoMutDocument`.
pub enum UpdateOp {
    /// Describes the `set` update that was performed.
    Set,
    /// Describes the `remove` update that was performed.
    Removed,
    /// Describes the `replace_with_counter` update that was performed.
    ReplacedWithCounter,
    /// Describes the `increment` update that was performed.
    Incremented,
}