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§
source§impl Clone for WriteStrategy
impl Clone for WriteStrategy
source§fn clone(&self) -> WriteStrategy
fn clone(&self) -> WriteStrategy
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for WriteStrategy
impl Debug for WriteStrategy
source§impl PartialEq for WriteStrategy
impl PartialEq for WriteStrategy
source§fn eq(&self, other: &WriteStrategy) -> bool
fn eq(&self, other: &WriteStrategy) -> bool
self
and other
values to be equal, and is used
by ==
.