pub struct CachedApiClient<T>{ /* private fields */ }Expand description
Cached API client wrapper
Implementations§
Source§impl<T> CachedApiClient<T>
impl<T> CachedApiClient<T>
pub fn new(config: CacheConfig) -> Self
Sourcepub async fn get_cached<F, Fut>(&self, key: CacheKey, fetch_fn: F) -> Result<T>
pub async fn get_cached<F, Fut>(&self, key: CacheKey, fetch_fn: F) -> Result<T>
Get data with caching
Sourcepub async fn metrics(&self) -> CacheMetrics
pub async fn metrics(&self) -> CacheMetrics
Get cache metrics
Auto Trait Implementations§
impl<T> !RefUnwindSafe for CachedApiClient<T>
impl<T> !UnwindSafe for CachedApiClient<T>
impl<T> Freeze for CachedApiClient<T>where
IntelligentCache<T>: Freeze,
impl<T> Send for CachedApiClient<T>where
IntelligentCache<T>: Send,
impl<T> Sync for CachedApiClient<T>where
IntelligentCache<T>: Sync,
impl<T> Unpin for CachedApiClient<T>where
IntelligentCache<T>: Unpin,
impl<T> UnsafeUnpin for CachedApiClient<T>where
IntelligentCache<T>: UnsafeUnpin,
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