pub struct InvalidationEvent {
pub ns: Namespace,
pub key: StructuredKey,
pub generation: u64,
pub message_id: u64,
pub applied_region: Option<RegionId>,
pub value: Option<Vec<u8>>,
pub residency_degraded: bool,
pub affects_subscriber_view: bool,
}Expand description
Invalidation event streamed to remote near-caches.
Fields§
§ns: NamespaceNamespace.
key: StructuredKeyStructured key.
generation: u64B1 source generation.
message_id: u64B1 message id.
applied_region: Option<RegionId>Region where the event was applied.
value: Option<Vec<u8>>Optional value, gated by residency.
residency_degraded: boolWhether value was stripped by residency.
affects_subscriber_view: boolWhether this event affects a subscriber’s tracked cross-region view.
Implementations§
Source§impl InvalidationEvent
impl InvalidationEvent
Sourcepub fn new(
ns: Namespace,
key: StructuredKey,
generation: u64,
message_id: u64,
) -> Self
pub fn new( ns: Namespace, key: StructuredKey, generation: u64, message_id: u64, ) -> Self
Create an invalidation event.
Sourcepub fn applied_in(self, region: RegionId) -> Self
pub fn applied_in(self, region: RegionId) -> Self
Attach applied region.
Sourcepub fn with_value(self, value: Vec<u8>) -> Self
pub fn with_value(self, value: Vec<u8>) -> Self
Attach an optional value.
Sourcepub fn affects_subscriber_view(self) -> Self
pub fn affects_subscriber_view(self) -> Self
Mark that a cross-region invalidation affects the subscriber’s tracked view.
Sourcepub fn should_deliver_to(&self, region: Option<&RegionId>) -> bool
pub fn should_deliver_to(&self, region: Option<&RegionId>) -> bool
Return whether this event should be delivered for a region filter.
Sourcepub fn residency_gated(self, value_allowed: bool) -> Self
pub fn residency_gated(self, value_allowed: bool) -> Self
Enforce residency for include-value streams.
Trait Implementations§
Source§impl Clone for InvalidationEvent
impl Clone for InvalidationEvent
Source§fn clone(&self) -> InvalidationEvent
fn clone(&self) -> InvalidationEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InvalidationEvent
impl Debug for InvalidationEvent
Source§impl<'de> Deserialize<'de> for InvalidationEvent
impl<'de> Deserialize<'de> for InvalidationEvent
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
impl Eq for InvalidationEvent
Source§impl PartialEq for InvalidationEvent
impl PartialEq for InvalidationEvent
Source§fn eq(&self, other: &InvalidationEvent) -> bool
fn eq(&self, other: &InvalidationEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for InvalidationEvent
impl Serialize for InvalidationEvent
impl StructuralPartialEq for InvalidationEvent
Auto Trait Implementations§
impl Freeze for InvalidationEvent
impl RefUnwindSafe for InvalidationEvent
impl Send for InvalidationEvent
impl Sync for InvalidationEvent
impl Unpin for InvalidationEvent
impl UnsafeUnpin for InvalidationEvent
impl UnwindSafe for InvalidationEvent
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