pub struct ConflictContext { /* private fields */ }Expand description
Context available to a conflict handler during changeset application.
Wraps the raw sqlite3_changeset_iter to provide safe access to the
table name, column count, and column values involved in a conflict.
Implementations§
Source§impl ConflictContext
impl ConflictContext
Sourcepub fn table_name(&self) -> &str
pub fn table_name(&self) -> &str
The table name for this conflict’s operation.
Sourcepub fn column_count(&self) -> usize
pub fn column_count(&self) -> usize
The number of columns in this table.
Sourcepub fn new_value(&self, col: usize) -> Option<String>
pub fn new_value(&self, col: usize) -> Option<String>
Get the “new” value for a column (the incoming value from the changeset). Available for DATA and CONSTRAINT conflicts. Returns None if the column was not changed or the value is NULL.
Sourcepub fn conflict_value(&self, col: usize) -> Option<String>
pub fn conflict_value(&self, col: usize) -> Option<String>
Get the “conflict” value for a column (the current local value). Available for DATA and CONFLICT conflicts.
Auto Trait Implementations§
impl Freeze for ConflictContext
impl RefUnwindSafe for ConflictContext
impl !Send for ConflictContext
impl !Sync for ConflictContext
impl Unpin for ConflictContext
impl UnwindSafe for ConflictContext
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<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>
Converts
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>
Converts
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 moreCreates a shared type from an unshared type.