pub enum Upsert<T> {
Put(T),
Keep,
Delete,
}Expand description
A write decision for one key.
Returned by an upsert closure — which sees one
key — and by an update_many closure, which
decides per key across a batch. Both take the decision under the shard lock
and apply exactly one of:
Put— insert or overwrite the valueKeep— leave the row unchanged (no write, no hook)Delete— remove the row if present; no-op if absent
update_many reports the outcome per key as an Applied.
Variants§
Put(T)
Store T at the key (insert or overwrite).
Keep
Do not write; the existing row (or absence) is left as-is.
Delete
Delete the key if it exists; absent keys stay absent.
Trait Implementations§
impl<T: Eq> Eq for Upsert<T>
Source§impl<T> IntoUpsert<T> for Upsert<T>
impl<T> IntoUpsert<T> for Upsert<T>
impl<T: PartialEq> StructuralPartialEq for Upsert<T>
Auto Trait Implementations§
impl<T> Freeze for Upsert<T>where
T: Freeze,
impl<T> RefUnwindSafe for Upsert<T>where
T: RefUnwindSafe,
impl<T> Send for Upsert<T>where
T: Send,
impl<T> Sync for Upsert<T>where
T: Sync,
impl<T> Unpin for Upsert<T>where
T: Unpin,
impl<T> UnsafeUnpin for Upsert<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Upsert<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.