pub struct Change {
pub table: String,
pub operation: ChangeOperation,
pub row_id: Option<Uuid>,
pub changed_columns: Vec<String>,
}Expand description
A database change event.
Fields§
§table: StringTable that changed.
operation: ChangeOperationType of operation.
row_id: Option<Uuid>Row ID that changed.
changed_columns: Vec<String>Columns that changed (for updates).
Implementations§
Source§impl Change
impl Change
Sourcepub fn new(table: impl Into<String>, operation: ChangeOperation) -> Self
pub fn new(table: impl Into<String>, operation: ChangeOperation) -> Self
Create a new change event.
Sourcepub fn with_row_id(self, row_id: Uuid) -> Self
pub fn with_row_id(self, row_id: Uuid) -> Self
Set the row ID.
Sourcepub fn with_columns(self, columns: Vec<String>) -> Self
pub fn with_columns(self, columns: Vec<String>) -> Self
Set the changed columns.
Sourcepub fn invalidates(&self, read_set: &ReadSet) -> bool
pub fn invalidates(&self, read_set: &ReadSet) -> bool
Check if this change should invalidate a read set.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Change
impl RefUnwindSafe for Change
impl Send for Change
impl Sync for Change
impl Unpin for Change
impl UnwindSafe for Change
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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 more