pub struct SubscriptionInfo {
pub id: SubscriptionId,
pub session_id: SessionId,
pub query_name: String,
pub args: Value,
pub query_hash: String,
pub read_set: ReadSet,
pub last_result_hash: Option<String>,
pub created_at: DateTime<Utc>,
pub last_executed_at: Option<DateTime<Utc>>,
pub execution_count: u64,
pub memory_bytes: usize,
}Expand description
Information about a server-side subscription.
Fields§
§id: SubscriptionIdUnique subscription ID.
session_id: SessionIdSession that owns this subscription.
query_name: StringQuery function name.
args: ValueQuery arguments (as JSON).
query_hash: StringHash of query + args for deduplication.
read_set: ReadSetRead set from last execution.
last_result_hash: Option<String>Hash of last result for delta computation.
created_at: DateTime<Utc>When the subscription was created.
last_executed_at: Option<DateTime<Utc>>When the subscription was last executed.
execution_count: u64Number of times the subscription has been re-executed.
memory_bytes: usizeEstimated memory usage in bytes.
Implementations§
Source§impl SubscriptionInfo
impl SubscriptionInfo
Sourcepub fn new(
session_id: SessionId,
query_name: impl Into<String>,
args: Value,
) -> Self
pub fn new( session_id: SessionId, query_name: impl Into<String>, args: Value, ) -> Self
Create a new subscription info.
Sourcepub fn record_execution(&mut self, read_set: ReadSet, result_hash: String)
pub fn record_execution(&mut self, read_set: ReadSet, result_hash: String)
Update after execution.
Sourcepub fn should_invalidate(&self, change: &Change) -> bool
pub fn should_invalidate(&self, change: &Change) -> bool
Check if a change should invalidate this subscription.
Trait Implementations§
Source§impl Clone for SubscriptionInfo
impl Clone for SubscriptionInfo
Source§fn clone(&self) -> SubscriptionInfo
fn clone(&self) -> SubscriptionInfo
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SubscriptionInfo
impl RefUnwindSafe for SubscriptionInfo
impl Send for SubscriptionInfo
impl Sync for SubscriptionInfo
impl Unpin for SubscriptionInfo
impl UnwindSafe for SubscriptionInfo
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