pub struct CacheEvent { /* private fields */ }Expand description
Metadata-only cache event.
Implementations§
Source§impl CacheEvent
impl CacheEvent
Sourcepub fn for_key<I, S>(
kind: CacheEventKind,
key: impl Into<String>,
origin: CacheEventOrigin,
tags: I,
) -> Self
pub fn for_key<I, S>( kind: CacheEventKind, key: impl Into<String>, origin: CacheEventOrigin, tags: I, ) -> Self
Create a key-scoped event.
Sourcepub fn for_tag(
kind: CacheEventKind,
tag: impl Into<String>,
affected_keys: u64,
origin: CacheEventOrigin,
) -> Self
pub fn for_tag( kind: CacheEventKind, tag: impl Into<String>, affected_keys: u64, origin: CacheEventOrigin, ) -> Self
Create a tag-scoped event.
Sourcepub fn for_cache(
kind: CacheEventKind,
affected_keys: Option<u64>,
origin: CacheEventOrigin,
) -> Self
pub fn for_cache( kind: CacheEventKind, affected_keys: Option<u64>, origin: CacheEventOrigin, ) -> Self
Create a cache-wide event.
Sourcepub fn kind(&self) -> CacheEventKind
pub fn kind(&self) -> CacheEventKind
Return the event kind.
Sourcepub fn scope(&self) -> &CacheEventScope
pub fn scope(&self) -> &CacheEventScope
Return the event scope.
Sourcepub fn origin(&self) -> CacheEventOrigin
pub fn origin(&self) -> CacheEventOrigin
Return the event origin.
Return event tags associated with the key or invalidation.
Sourcepub fn affected_keys(&self) -> Option<u64>
pub fn affected_keys(&self) -> Option<u64>
Return the affected-key count when known.
Sourcepub fn timestamp(&self) -> SystemTime
pub fn timestamp(&self) -> SystemTime
Return the event timestamp.
Trait Implementations§
Source§impl Clone for CacheEvent
impl Clone for CacheEvent
Source§fn clone(&self) -> CacheEvent
fn clone(&self) -> CacheEvent
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 CacheEvent
impl Debug for CacheEvent
impl Eq for CacheEvent
Source§impl PartialEq for CacheEvent
impl PartialEq for CacheEvent
Source§fn eq(&self, other: &CacheEvent) -> bool
fn eq(&self, other: &CacheEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CacheEvent
Auto Trait Implementations§
impl Freeze for CacheEvent
impl RefUnwindSafe for CacheEvent
impl Send for CacheEvent
impl Sync for CacheEvent
impl Unpin for CacheEvent
impl UnsafeUnpin for CacheEvent
impl UnwindSafe for CacheEvent
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