pub enum InvalidationMessage {
Remove {
key: String,
},
Update {
key: String,
value: Value,
ttl_secs: Option<u64>,
},
RemovePattern {
pattern: String,
},
RemoveBulk {
keys: Vec<String>,
},
}Expand description
Invalidation message types sent across cache instances via Redis Pub/Sub
Variants§
Remove
Remove a single key from all cache instances
Update
Update a key with new value across all cache instances This is more efficient than Remove for hot keys as it avoids cache miss
RemovePattern
Remove all keys matching a pattern from all cache instances Uses glob-style patterns (e.g., “user:”, “product:123:”)
RemoveBulk
Bulk remove multiple keys at once
Implementations§
Source§impl InvalidationMessage
impl InvalidationMessage
Sourcepub fn update(
key: impl Into<String>,
value: Value,
ttl: Option<Duration>,
) -> Self
pub fn update( key: impl Into<String>, value: Value, ttl: Option<Duration>, ) -> Self
Create an Update message
Sourcepub fn remove_pattern(pattern: impl Into<String>) -> Self
pub fn remove_pattern(pattern: impl Into<String>) -> Self
Create a RemovePattern message
Sourcepub fn remove_bulk(keys: Vec<String>) -> Self
pub fn remove_bulk(keys: Vec<String>) -> Self
Create a RemoveBulk message
Trait Implementations§
Source§impl Clone for InvalidationMessage
impl Clone for InvalidationMessage
Source§fn clone(&self) -> InvalidationMessage
fn clone(&self) -> InvalidationMessage
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for InvalidationMessage
impl Debug for InvalidationMessage
Source§impl<'de> Deserialize<'de> for InvalidationMessage
impl<'de> Deserialize<'de> for InvalidationMessage
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 InvalidationMessage
impl RefUnwindSafe for InvalidationMessage
impl Send for InvalidationMessage
impl Sync for InvalidationMessage
impl Unpin for InvalidationMessage
impl UnwindSafe for InvalidationMessage
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)