dittolive_ditto/store/query_builder/
update.rs

1/// Describes the result of an update operation performed on a [`DittoMutDocument`].
2///
3/// - set: Describes the `set` update that was performed.
4/// - removed: Describes the `remove` update that was performed.
5/// - incremented: Describes the `increment` update that was performed.
6///
7/// [`DittoMutDocument`]: crate::store::query_builder::DittoMutDocument
8#[deprecated(
9    since = "4.14.4",
10    note = "Will be removed in SDK 5.0. Use DQL queries instead"
11)]
12pub struct UpdateResult {
13    /// The type of update operation performed.
14    pub op: UpdateOp,
15
16    /// The ID of the document updated.
17    pub doc_id: String,
18
19    /// The path to the field in the document that was updated.
20    pub path: String,
21
22    /// A printable representation of the updated value.
23    pub value: Box<dyn std::fmt::Debug>, // we only care if we can print the value
24}
25
26/// Update operation performed on a `DittoMutDocument`.
27#[deprecated(
28    since = "4.14.4",
29    note = "Will be removed in SDK 5.0. Use DQL queries instead"
30)]
31pub enum UpdateOp {
32    /// Describes the `set` update that was performed.
33    Set,
34
35    /// Describes the `remove` update that was performed.
36    Removed,
37
38    /// Describes the `replace_with_counter` update that was performed.
39    ReplacedWithCounter,
40
41    /// Describes the `increment` update that was performed.
42    Incremented,
43}