Enum ruarango::doc::input::OverwriteMode
source · pub enum OverwriteMode {
Ignore,
Update,
Replace,
Conflict,
}
Expand description
Overwrite Modes
Variants§
Ignore
If a document with the specified _key
value exists already,
nothing will be done and no write operation will be carried out. The
insert operation will return success in this case. This mode does not
support returning the old document version using return_old
. When using
return_new
, None
will be returned in case the document already existed.
Update
If a document with the specified _key
value exists already,
it will be patched (partially updated) with the specified document value.
The overwrite_mode
can be further controlled via the keep_null
and
merge_objects
configuration.
Replace
If a document with the specified _key
value exists already,
it will be overwritten with the specified document value. This mode will
also be used when no overwrite_mode
is specified but the overwrite
flag is set to true.
Conflict
If a document with the specified _key
value exists already,
return a unique constraint violation error so that the insert operation
fails. This is also the default behavior in case the overwrite_mode
is
not set, and the overwrite
flag is false or not set either.
Trait Implementations§
source§impl Clone for OverwriteMode
impl Clone for OverwriteMode
source§fn clone(&self) -> OverwriteMode
fn clone(&self) -> OverwriteMode
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for OverwriteMode
impl Debug for OverwriteMode
source§impl<'de> Deserialize<'de> for OverwriteMode
impl<'de> Deserialize<'de> for OverwriteMode
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
source§impl Display for OverwriteMode
impl Display for OverwriteMode
source§impl PartialEq<OverwriteMode> for OverwriteMode
impl PartialEq<OverwriteMode> for OverwriteMode
source§fn eq(&self, other: &OverwriteMode) -> bool
fn eq(&self, other: &OverwriteMode) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for OverwriteMode
impl Serialize for OverwriteMode
impl Copy for OverwriteMode
impl Eq for OverwriteMode
impl StructuralEq for OverwriteMode
impl StructuralPartialEq for OverwriteMode
Auto Trait Implementations§
impl RefUnwindSafe for OverwriteMode
impl Send for OverwriteMode
impl Sync for OverwriteMode
impl Unpin for OverwriteMode
impl UnwindSafe for OverwriteMode
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.