pub struct ChangesetRow {
pub op: ChangeOp,
pub old_values: Vec<ChangesetValue>,
pub new_values: Vec<ChangesetValue>,
}Expand description
A single row change recorded in a changeset.
Fields§
§op: ChangeOp§old_values: Vec<ChangesetValue>For DELETE and UPDATE: the old column values. Empty for INSERT.
new_values: Vec<ChangesetValue>For INSERT and UPDATE: the new column values. Empty for DELETE.
Implementations§
Source§impl ChangesetRow
impl ChangesetRow
Sourcepub fn encode_changeset(&self, out: &mut Vec<u8>)
pub fn encode_changeset(&self, out: &mut Vec<u8>)
Encode this row change into changeset binary format.
Sourcepub fn encode_patchset(&self, out: &mut Vec<u8>, pk_flags: &[bool])
pub fn encode_patchset(&self, out: &mut Vec<u8>, pk_flags: &[bool])
Encode this row change into patchset binary format.
For INSERT and DELETE this is identical to changeset encoding.
For UPDATE the patchset stores a single record whose PK slots contain
the original key values and whose non-PK slots contain changed new
values or ChangesetValue::Undefined for unchanged columns.
Sourcepub fn decode_changeset(
data: &[u8],
pos: usize,
col_count: usize,
) -> Option<(Self, usize)>
pub fn decode_changeset( data: &[u8], pos: usize, col_count: usize, ) -> Option<(Self, usize)>
Decode one changeset row starting at pos, given the column count.
Sourcepub fn decode_patchset(
data: &[u8],
pos: usize,
col_count: usize,
pk_flags: &[bool],
) -> Option<(Self, usize)>
pub fn decode_patchset( data: &[u8], pos: usize, col_count: usize, pk_flags: &[bool], ) -> Option<(Self, usize)>
Decode one patchset row starting at pos.
Patchset UPDATE rows only store primary-key old values. Non-PK old
values are reconstructed as ChangesetValue::Undefined so the
decoded row can reuse the normal apply path.
Trait Implementations§
Source§impl Clone for ChangesetRow
impl Clone for ChangesetRow
Source§fn clone(&self) -> ChangesetRow
fn clone(&self) -> ChangesetRow
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more