dittolive-ditto 4.11.1

Ditto is a peer to peer cross-platform database that allows mobile, web, IoT and server apps to sync with or without an internet connection.
/// 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.
///
/// [`DittoMutDocument`]: crate::store::query_builder::DittoMutDocument
pub struct UpdateResult {
    /// The type of update operation performed.
    pub op: UpdateOp,

    /// The ID of the document updated.
    pub doc_id: String,

    /// The path to the field in the document that was updated.
    pub path: String,

    /// A printable representation of the updated value.
    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,
}