pub struct ModelStorage {
pub location: StorageLocation,
}Expand description
Model storage manager
Fields§
§location: StorageLocationImplementations§
Source§impl ModelStorage
impl ModelStorage
Sourcepub fn model_path(&self, model_id: &str, filename: &str) -> PathBuf
pub fn model_path(&self, model_id: &str, filename: &str) -> PathBuf
Get the full path for a model file
Sourcepub fn metadata_path(&self, model_id: &str) -> PathBuf
pub fn metadata_path(&self, model_id: &str) -> PathBuf
Get the path for model metadata
Sourcepub fn list_models(&self) -> Result<Vec<String>>
pub fn list_models(&self) -> Result<Vec<String>>
List all available models in storage
Sourcepub fn model_exists(&self, model_id: &str) -> bool
pub fn model_exists(&self, model_id: &str) -> bool
Check if a model exists locally
Sourcepub fn get_storage_usage(&self) -> Result<u64>
pub fn get_storage_usage(&self) -> Result<u64>
Get total storage usage
Sourcepub fn remove_model(&self, model_id: &str) -> Result<()>
pub fn remove_model(&self, model_id: &str) -> Result<()>
Remove a model from storage
Sourcepub fn create_model_directory(&self, model_id: &str) -> Result<PathBuf>
pub fn create_model_directory(&self, model_id: &str) -> Result<PathBuf>
Create model directory structure
Sourcepub fn get_available_space(&self) -> Result<u64>
pub fn get_available_space(&self) -> Result<u64>
Get available disk space (cross-platform)
Auto Trait Implementations§
impl Freeze for ModelStorage
impl RefUnwindSafe for ModelStorage
impl Send for ModelStorage
impl Sync for ModelStorage
impl Unpin for ModelStorage
impl UnsafeUnpin for ModelStorage
impl UnwindSafe for ModelStorage
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