pub struct ExchangeRateCache { /* private fields */ }Expand description
High-performance cache for exchange rate data
Implementations§
Source§impl ExchangeRateCache
impl ExchangeRateCache
Sourcepub fn with_config(config: CacheConfig) -> Self
pub fn with_config(config: CacheConfig) -> Self
Create a new cache with custom configuration
Sourcepub async fn get(&self, key: &CacheKey) -> Option<ExchangeRateResponse>
pub async fn get(&self, key: &CacheKey) -> Option<ExchangeRateResponse>
Get cached rates if available and valid
Sourcepub async fn put(&self, key: CacheKey, data: ExchangeRateResponse)
pub async fn put(&self, key: CacheKey, data: ExchangeRateResponse)
Cache exchange rate data
Sourcepub fn get_stats(&self) -> CacheStats
pub fn get_stats(&self) -> CacheStats
Get cache statistics
Sourcepub async fn cleanup_expired(&self)
pub async fn cleanup_expired(&self)
Remove expired entries manually
Trait Implementations§
Source§impl Clone for ExchangeRateCache
impl Clone for ExchangeRateCache
Source§fn clone(&self) -> ExchangeRateCache
fn clone(&self) -> ExchangeRateCache
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 ExchangeRateCache
impl Debug for ExchangeRateCache
Auto Trait Implementations§
impl Freeze for ExchangeRateCache
impl !RefUnwindSafe for ExchangeRateCache
impl Send for ExchangeRateCache
impl Sync for ExchangeRateCache
impl Unpin for ExchangeRateCache
impl !UnwindSafe for ExchangeRateCache
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