pub struct RowChange {
pub table: String,
pub op: ChangeOp,
pub columns: Vec<Option<String>>,
/* private fields */
}Expand description
One row change extracted from a changeset.
columns holds the row’s column values in schema order. Inserts and updates
contain the resulting values; deletes contain the removed values. Unchanged
update columns are filled from the old side so primary keys and foreign keys
remain available.
None means SQL NULL or a column absent from the changeset.
Fields§
§table: String§op: ChangeOp§columns: Vec<Option<String>>Implementations§
Source§impl RowChange
impl RowChange
Sourcepub fn new(
table: String,
op: ChangeOp,
columns: Vec<Option<String>>,
changed_columns: Vec<bool>,
) -> RowChange
pub fn new( table: String, op: ChangeOp, columns: Vec<Option<String>>, changed_columns: Vec<bool>, ) -> RowChange
Build a row change from equally sized column-value and changed-column vectors. The decoder is the sole producer; keeping the marker beside the decoded row preserves SQLite’s distinction between an unchanged value copied from the old side and a value written by this UPDATE.
Sourcepub fn column_changed(&self, i: usize) -> bool
pub fn column_changed(&self, i: usize) -> bool
Whether this column was written by the change. Inserts and deletes affect
every value in their row; updates mark only values present on SQLite’s new
side, even though Self::col fills unchanged values from the old side.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RowChange
impl RefUnwindSafe for RowChange
impl Send for RowChange
impl Sync for RowChange
impl Unpin for RowChange
impl UnsafeUnpin for RowChange
impl UnwindSafe for RowChange
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more