pub struct KeyPattern { /* private fields */ }Expand description
A pattern for matching cache keys.
Supports glob-style patterns with * wildcards.
Implementations§
Source§impl KeyPattern
impl KeyPattern
Sourcepub fn record<I: Display>(entity: &str, id: I) -> Self
pub fn record<I: Display>(entity: &str, id: I) -> Self
Create a pattern matching a specific record (with relations).
Sourcepub fn with_prefix(prefix: &str, pattern: &str) -> Self
pub fn with_prefix(prefix: &str, pattern: &str) -> Self
Create a pattern with a custom prefix.
Sourcepub fn matches_str(&self, key: &str) -> bool
pub fn matches_str(&self, key: &str) -> bool
Check if a string matches this pattern.
Sourcepub fn to_redis_pattern(&self) -> String
pub fn to_redis_pattern(&self) -> String
Convert to a Redis-compatible pattern.
Trait Implementations§
Source§impl Clone for KeyPattern
impl Clone for KeyPattern
Source§fn clone(&self) -> KeyPattern
fn clone(&self) -> KeyPattern
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 moreSource§impl Debug for KeyPattern
impl Debug for KeyPattern
Source§impl Display for KeyPattern
impl Display for KeyPattern
Source§impl PartialEq for KeyPattern
impl PartialEq for KeyPattern
impl Eq for KeyPattern
impl StructuralPartialEq for KeyPattern
Auto Trait Implementations§
impl Freeze for KeyPattern
impl RefUnwindSafe for KeyPattern
impl Send for KeyPattern
impl Sync for KeyPattern
impl Unpin for KeyPattern
impl UnwindSafe for KeyPattern
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