pub enum ChangesetOp<'a, T, S, B> {
Insert {
table: &'a T,
values: &'a [Value<S, B>],
indirect: bool,
},
Update {
table: &'a T,
values: &'a [ChangesetUpdatePair<S, B>],
indirect: bool,
},
Delete {
table: &'a T,
old_values: &'a [Value<S, B>],
indirect: bool,
},
}Expand description
View over one operation in a changeset.
Variants§
Insert
INSERT. Carries every column’s value in column order.
Fields
Update
UPDATE. Carries (old, new) pairs per column. None in either
slot means “undefined” (the column was not part of the diff).
Fields
§
values: &'a [ChangesetUpdatePair<S, B>](old, new) pairs, one per column.
Delete
DELETE. Carries the full old-row values in column order.
Implementations§
Source§impl<'a, T, S, B> ChangesetOp<'a, T, S, B>
impl<'a, T, S, B> ChangesetOp<'a, T, S, B>
Source§impl<T: SchemaWithPK, S: Clone, B: Clone> ChangesetOp<'_, T, S, B>
impl<T: SchemaWithPK, S: Clone, B: Clone> ChangesetOp<'_, T, S, B>
Sourcepub fn primary_key(&self) -> Vec<Value<S, B>>
pub fn primary_key(&self) -> Vec<Value<S, B>>
Returns the primary-key cells of this operation, in key order.
Insert and Delete read the key from the full row via
SchemaWithPK::extract_pk. For Update each key cell is taken
old-first: a changeset UPDATE carries the key in the old slot as the
row identity, while the new slot is absent for a key column that did
not change, so reading the new slot (as extract_pk would over the
pair storage) can yield None.
Trait Implementations§
Auto Trait Implementations§
impl<'a, T, S, B> Freeze for ChangesetOp<'a, T, S, B>
impl<'a, T, S, B> RefUnwindSafe for ChangesetOp<'a, T, S, B>
impl<'a, T, S, B> Send for ChangesetOp<'a, T, S, B>
impl<'a, T, S, B> Sync for ChangesetOp<'a, T, S, B>
impl<'a, T, S, B> Unpin for ChangesetOp<'a, T, S, B>
impl<'a, T, S, B> UnsafeUnpin for ChangesetOp<'a, T, S, B>
impl<'a, T, S, B> UnwindSafe for ChangesetOp<'a, T, S, B>
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