pub struct AuthCache { /* private fields */ }
Expand description
Auth cache with TTL and auto cleanup
Implementations§
Source§impl AuthCache
impl AuthCache
Sourcepub fn new(config: CacheConfig) -> AuthResult<Self>
pub fn new(config: CacheConfig) -> AuthResult<Self>
Create a new auth cache instance
Sourcepub fn force_cleanup(&self)
pub fn force_cleanup(&self)
Force cleanup (sync)
Sourcepub fn stats(&self) -> CacheStats
pub fn stats(&self) -> CacheStats
Get cache statistics
Sourcepub fn contains_key(&self, key: &[u8; 32]) -> bool
pub fn contains_key(&self, key: &[u8; 32]) -> bool
Check if the cache contains a key
Sourcepub fn config(&self) -> &CacheConfig
pub fn config(&self) -> &CacheConfig
Get the cache configuration
Auto Trait Implementations§
impl Freeze for AuthCache
impl !RefUnwindSafe for AuthCache
impl Send for AuthCache
impl Sync for AuthCache
impl Unpin for AuthCache
impl !UnwindSafe for AuthCache
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