pub struct ModelCache { /* private fields */ }Expand description
Model cache manager
Implementations§
Source§impl ModelCache
impl ModelCache
Sourcepub fn model_path(&self, model_id: &str) -> PathBuf
pub fn model_path(&self, model_id: &str) -> PathBuf
Get path for a specific model
Sourcepub fn metadata_path(&self, model_id: &str) -> PathBuf
pub fn metadata_path(&self, model_id: &str) -> PathBuf
Get metadata file path for a model
Sourcepub async fn load_metadata(
&self,
model_id: &str,
) -> Result<Option<ModelMetadata>>
pub async fn load_metadata( &self, model_id: &str, ) -> Result<Option<ModelMetadata>>
Load metadata for a cached model
Sourcepub async fn save_metadata(&self, metadata: &ModelMetadata) -> Result<()>
pub async fn save_metadata(&self, metadata: &ModelMetadata) -> Result<()>
Save metadata for a cached model
Sourcepub async fn validate(
&self,
model_id: &str,
expected_checksum: Option<&str>,
) -> Result<bool>
pub async fn validate( &self, model_id: &str, expected_checksum: Option<&str>, ) -> Result<bool>
Validate model file integrity using checksum
Sourcepub async fn update_access(&self, model_id: &str) -> Result<()>
pub async fn update_access(&self, model_id: &str) -> Result<()>
Update last access time for a model
Sourcepub async fn list_models(&self) -> Result<Vec<String>>
pub async fn list_models(&self) -> Result<Vec<String>>
List all cached models
Sourcepub async fn delete_model(&self, model_id: &str) -> Result<()>
pub async fn delete_model(&self, model_id: &str) -> Result<()>
Delete a cached model
Auto Trait Implementations§
impl Freeze for ModelCache
impl !RefUnwindSafe for ModelCache
impl Send for ModelCache
impl Sync for ModelCache
impl Unpin for ModelCache
impl UnsafeUnpin for ModelCache
impl !UnwindSafe for ModelCache
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 more