pub struct KevySpamCache { /* private fields */ }Expand description
Kevy-backed SpamCache using an in-process kevy_embedded::Store.
The cache silently ignores all store errors — a missing/failed
lookup always falls through to the provider, and a failed set
just loses one cache entry. Both situations are recoverable
without breaking classification.
Implementations§
Trait Implementations§
Source§impl Clone for KevySpamCache
impl Clone for KevySpamCache
Source§fn clone(&self) -> KevySpamCache
fn clone(&self) -> KevySpamCache
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 KevySpamCache
impl Debug for KevySpamCache
Source§impl SpamCache for KevySpamCache
impl SpamCache for KevySpamCache
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
key: &'life1 str,
) -> Pin<Box<dyn Future<Output = Option<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Look up a cached result by key. Return
None on miss or error.Source§fn set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 str,
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
key: &'life1 str,
value: &'life2 str,
ttl_secs: u64,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Store a result with TTL (seconds). Errors are ignored.
Auto Trait Implementations§
impl Freeze for KevySpamCache
impl RefUnwindSafe for KevySpamCache
impl Send for KevySpamCache
impl Sync for KevySpamCache
impl Unpin for KevySpamCache
impl UnsafeUnpin for KevySpamCache
impl UnwindSafe for KevySpamCache
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