#[non_exhaustive]
pub enum WriteStrategy {
    Merge,
    InsertIfAbsent,
    InsertDefaultIfAbsent,
}
Expand description

Specify the write strategy when inserting documents.

Variants (Non-exhaustive)

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.

Merge

An existing document will be merged with the document being inserted, if there is a pre-existing document.

InsertIfAbsent

Insert the document only if there is not already a document with the same Id in the store. If there is already a document in the store with the same Id then this will be a no-op.

InsertDefaultIfAbsent

Insert the document, with its contents treated as default data, only if there is not already a document with the same Id in the store. If there is already a document in the store with the same Id then this will be a no-op. Use this strategy if you want to insert default data for a given document Id, which you want to treat as common initial data amongst all peers and that you expect to be mutated or overwritten in due course.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Applies the [Compat] adapter by value. Read more
Applies the [Compat] adapter by shared reference. Read more
Applies the [Compat] adapter by mutable reference. Read more
Checks if this value is equivalent to the given key. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts to T by calling Into<T>::into.
Tries to convert to T by calling TryInto<T>::try_into.
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.