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 moresourceimpl Debug for WriteStrategy
impl Debug for WriteStrategy
sourceimpl PartialEq<WriteStrategy> for WriteStrategy
impl PartialEq<WriteStrategy> for WriteStrategy
sourcefn eq(&self, other: &WriteStrategy) -> bool
fn eq(&self, other: &WriteStrategy) -> bool
impl Copy for WriteStrategy
impl Eq for WriteStrategy
impl StructuralEq for WriteStrategy
impl StructuralPartialEq for WriteStrategy
Auto Trait Implementations
impl RefUnwindSafe for WriteStrategy
impl Send for WriteStrategy
impl Sync for WriteStrategy
impl Unpin for WriteStrategy
impl UnwindSafe for WriteStrategy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> CompatExt for T
impl<T> CompatExt for T
fn compat_ref(&self) -> Compat<&T>
fn compat_ref(&self) -> Compat<&T>
Compat
] adapter by shared reference. Read morefn compat_mut(&mut self) -> Compat<&mut T>
fn compat_mut(&mut self) -> Compat<&mut T>
Compat
] adapter by mutable reference. Read more