pub enum SubscriptionUpdate {
Full {
subscription_id: SubscriptionId,
rows: Vec<Row>,
},
Delta {
subscription_id: SubscriptionId,
inserts: Vec<Row>,
updates: Vec<(Row, Row)>,
deletes: Vec<Row>,
},
Error {
subscription_id: SubscriptionId,
message: String,
},
Partial {
subscription_id: SubscriptionId,
updates: Vec<PartialRowDelta>,
},
}Expand description
Update notification sent to subscribers
When a subscription’s results change, an update is sent through the subscription’s notification channel.
Variants§
Full
Full result set (initial subscription or major change)
Contains all rows matching the query. This is sent when:
- A new subscription is created (initial results)
- The results have changed and delta calculation isn’t available
Fields
subscription_id: SubscriptionIdThe subscription ID this update is for
Delta
Incremental delta update
Contains only the changes since the last update. More efficient for large result sets with small changes. Sent when the change can be expressed as a set of inserts, updates, and deletes.
Fields
subscription_id: SubscriptionIdThe subscription ID this update is for
Error
Query execution error
Sent when the subscription query fails to execute, typically due to schema changes that invalidate the query.
Fields
subscription_id: SubscriptionIdThe subscription ID this update is for
Partial
Partial row updates (selective column updates)
Sent when a subscription is eligible for selective column updates and only a subset of columns have changed. Contains only the changed columns plus the primary key columns, reducing bandwidth for wide tables.
This is more efficient than Delta for tables with many columns where only a few columns change at a time.
Fields
subscription_id: SubscriptionIdThe subscription ID this update is for
updates: Vec<PartialRowDelta>Partial row updates, each containing only changed columns + PK columns
Implementations§
Source§impl SubscriptionUpdate
impl SubscriptionUpdate
Sourcepub fn subscription_id(&self) -> SubscriptionId
pub fn subscription_id(&self) -> SubscriptionId
Get the subscription ID this update is for
Trait Implementations§
Source§impl Clone for SubscriptionUpdate
impl Clone for SubscriptionUpdate
Source§fn clone(&self) -> SubscriptionUpdate
fn clone(&self) -> SubscriptionUpdate
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for SubscriptionUpdate
impl RefUnwindSafe for SubscriptionUpdate
impl Send for SubscriptionUpdate
impl Sync for SubscriptionUpdate
impl Unpin for SubscriptionUpdate
impl UnsafeUnpin for SubscriptionUpdate
impl UnwindSafe for SubscriptionUpdate
Blanket Implementations§
impl<T> Allocation for T
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,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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>
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request