pub enum Diff {
Insert {
post: Arc<Columns>,
},
Update {
pre: Arc<Columns>,
post: Arc<Columns>,
},
Remove {
pre: Arc<Columns>,
},
}Expand description
Represents a single diff.
Carries Arc<Columns> so that cloning a Diff (or the enclosing
Change) is a refcount bump rather than a deep copy of every column,
and so that producers (e.g. CdcProducerActor) can hold onto a slab
pool of Arc<Columns> and reuse them across calls when strong_count
drops back to 1 after dispatch.
Variants§
Implementations§
Source§impl Diff
impl Diff
Sourcepub fn insert(post: Columns) -> Self
pub fn insert(post: Columns) -> Self
Build an insert diff from an owned Columns. Wraps internally.
Sourcepub fn update(pre: Columns, post: Columns) -> Self
pub fn update(pre: Columns, post: Columns) -> Self
Build an update diff from owned Columns. Wraps internally.
Sourcepub fn remove(pre: Columns) -> Self
pub fn remove(pre: Columns) -> Self
Build a remove diff from an owned Columns. Wraps internally.
Sourcepub fn insert_arc(post: Arc<Columns>) -> Self
pub fn insert_arc(post: Arc<Columns>) -> Self
Build an insert diff from an already-Arc’d Columns. Used by
the CdcProducerActor slab pool to avoid an extra Arc::new.
Sourcepub fn update_arc(pre: Arc<Columns>, post: Arc<Columns>) -> Self
pub fn update_arc(pre: Arc<Columns>, post: Arc<Columns>) -> Self
Build an update diff from already-Arc’d Columns.
Sourcepub fn remove_arc(pre: Arc<Columns>) -> Self
pub fn remove_arc(pre: Arc<Columns>) -> Self
Build a remove diff from an already-Arc’d Columns.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Diff
impl<'de> Deserialize<'de> for Diff
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Diff
impl RefUnwindSafe for Diff
impl Send for Diff
impl Sync for Diff
impl Unpin for Diff
impl UnsafeUnpin for Diff
impl UnwindSafe for Diff
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