pub struct ContainsMatcher { /* private fields */ }Expand description
String substring matcher for finding keys that contain a specific string.
This matcher searches for cache entries where the key contains the specified substring anywhere within it.
§Examples
use simple_cacher::*;
use std::time::Duration;
let mut cache = SimpleCacher::new(Duration::from_secs(300));
cache.insert("user_profile_123".to_string(), "Profile data".to_string());
cache.insert("user_settings_456".to_string(), "Settings data".to_string());
cache.insert("admin_config".to_string(), "Config data".to_string());
let profile_matcher = ContainsMatcher::new("profile");
let profiles = cache.get_all_by_matcher(&profile_matcher);
assert_eq!(profiles.len(), 1);Implementations§
Trait Implementations§
Source§impl Matcher<&str> for ContainsMatcher
impl Matcher<&str> for ContainsMatcher
Auto Trait Implementations§
impl Freeze for ContainsMatcher
impl RefUnwindSafe for ContainsMatcher
impl Send for ContainsMatcher
impl Sync for ContainsMatcher
impl Unpin for ContainsMatcher
impl UnwindSafe for ContainsMatcher
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