pub struct CacheEventOptions { /* private fields */ }Expand description
Subscription filters for cache events.
Filters are intentionally metadata-only. They are cheap enough to apply in the subscriber wrapper and avoid coupling event publication to decoded values.
Implementations§
Source§impl CacheEventOptions
impl CacheEventOptions
Sourcepub fn include_kind(self, kind: CacheEventKind) -> Self
pub fn include_kind(self, kind: CacheEventKind) -> Self
Include one event kind.
Sourcepub fn include_kinds<I>(self, kinds: I) -> Selfwhere
I: IntoIterator<Item = CacheEventKind>,
pub fn include_kinds<I>(self, kinds: I) -> Selfwhere
I: IntoIterator<Item = CacheEventKind>,
Include several event kinds.
Sourcepub fn exclude_kind(self, kind: CacheEventKind) -> Self
pub fn exclude_kind(self, kind: CacheEventKind) -> Self
Exclude one event kind.
Sourcepub fn exclude_kinds<I>(self, kinds: I) -> Selfwhere
I: IntoIterator<Item = CacheEventKind>,
pub fn exclude_kinds<I>(self, kinds: I) -> Selfwhere
I: IntoIterator<Item = CacheEventKind>,
Exclude several event kinds.
Sourcepub fn key_prefix(self, key_prefix: impl Into<String>) -> Self
pub fn key_prefix(self, key_prefix: impl Into<String>) -> Self
Restrict events to key-scoped events whose key starts with the prefix.
Sourcepub fn origin(self, origin: CacheEventOrigin) -> Self
pub fn origin(self, origin: CacheEventOrigin) -> Self
Restrict events to one origin.
Sourcepub fn value_mode(self, value_mode: CacheEventValueMode) -> Self
pub fn value_mode(self, value_mode: CacheEventValueMode) -> Self
Set the value mode requested by this subscription.
Sourcepub fn value_mode_value(&self) -> CacheEventValueMode
pub fn value_mode_value(&self) -> CacheEventValueMode
Return the requested value mode.
Sourcepub fn matches(&self, event: &CacheEvent) -> bool
pub fn matches(&self, event: &CacheEvent) -> bool
Return whether this event passes all filters.
Trait Implementations§
Source§impl Clone for CacheEventOptions
impl Clone for CacheEventOptions
Source§fn clone(&self) -> CacheEventOptions
fn clone(&self) -> CacheEventOptions
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 CacheEventOptions
impl Debug for CacheEventOptions
Source§impl Default for CacheEventOptions
impl Default for CacheEventOptions
Source§fn default() -> CacheEventOptions
fn default() -> CacheEventOptions
Returns the “default value” for a type. Read more
impl Eq for CacheEventOptions
Source§impl PartialEq for CacheEventOptions
impl PartialEq for CacheEventOptions
Source§fn eq(&self, other: &CacheEventOptions) -> bool
fn eq(&self, other: &CacheEventOptions) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CacheEventOptions
Auto Trait Implementations§
impl Freeze for CacheEventOptions
impl RefUnwindSafe for CacheEventOptions
impl Send for CacheEventOptions
impl Sync for CacheEventOptions
impl Unpin for CacheEventOptions
impl UnsafeUnpin for CacheEventOptions
impl UnwindSafe for CacheEventOptions
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