pub struct UnifiedCache;Implementations§
Source§impl UnifiedCache
impl UnifiedCache
Sourcepub fn models_dir() -> Result<PathBuf>
pub fn models_dir() -> Result<PathBuf>
Get the models directory path (cross-platform)
Sourcepub fn provider_cache_path(provider: &str) -> Result<PathBuf>
pub fn provider_cache_path(provider: &str) -> Result<PathBuf>
Get the cache file path for a specific provider
Sourcepub async fn is_cache_fresh(provider: &str) -> Result<bool>
pub async fn is_cache_fresh(provider: &str) -> Result<bool>
Check in-memory cache first, then file cache
Sourcepub fn invalidate_provider_cache(provider: &str)
pub fn invalidate_provider_cache(provider: &str)
Invalidate cache for a specific provider
Sourcepub fn clear_memory_cache()
pub fn clear_memory_cache()
Clear all in-memory cache
Sourcepub async fn get_cache_age_display(provider: &str) -> Result<String>
pub async fn get_cache_age_display(provider: &str) -> Result<String>
Get cache age in human-readable format (e.g., “5 mins ago”, “2 hrs ago”)
Sourcepub async fn load_provider_models(provider: &str) -> Result<Vec<ModelMetadata>>
pub async fn load_provider_models(provider: &str) -> Result<Vec<ModelMetadata>>
Load cached models for a provider (async with in-memory cache)
Sourcepub async fn fetch_and_cache_provider_models(
provider: &str,
force_refresh: bool,
) -> Result<Vec<ModelMetadata>>
pub async fn fetch_and_cache_provider_models( provider: &str, force_refresh: bool, ) -> Result<Vec<ModelMetadata>>
Fetch and cache models for a provider
Sourcepub async fn load_all_cached_models() -> Result<Vec<ModelMetadata>>
pub async fn load_all_cached_models() -> Result<Vec<ModelMetadata>>
Load all cached models from all providers (async with in-memory cache)
Sourcepub async fn refresh_all_providers() -> Result<()>
pub async fn refresh_all_providers() -> Result<()>
Refresh all providers’ caches
Auto Trait Implementations§
impl Freeze for UnifiedCache
impl RefUnwindSafe for UnifiedCache
impl Send for UnifiedCache
impl Sync for UnifiedCache
impl Unpin for UnifiedCache
impl UnwindSafe for UnifiedCache
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.