Enum dittolive_ditto::store::WriteStrategy
source · [−]#[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
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
sourceimpl Clone for WriteStrategy
impl Clone for WriteStrategy
sourcefn clone(&self) -> WriteStrategy
fn clone(&self) -> WriteStrategy
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more