pub struct ModelCacheLayout {
pub root: PathBuf,
pub model_dirs: Vec<ModelDirEntry>,
}Expand description
Description of the full cache directory tree.
Fields§
§root: PathBufRoot directory of the model cache.
model_dirs: Vec<ModelDirEntry>Per-model versioned directories.
Implementations§
Source§impl ModelCacheLayout
impl ModelCacheLayout
Sourcepub fn default_layout() -> Self
pub fn default_layout() -> Self
Build the layout using the default resolved root.
Sourcepub fn model_path(&self, dir_name: &str) -> Option<&Path>
pub fn model_path(&self, dir_name: &str) -> Option<&Path>
Get the base path for a model by directory name.
Sourcepub fn versioned_model_path(&self, dir_name: &str) -> Option<PathBuf>
pub fn versioned_model_path(&self, dir_name: &str) -> Option<PathBuf>
Get the versioned path for a model by directory name.
Sourcepub fn model_base_path(&self, dir_name: &str) -> Option<PathBuf>
pub fn model_base_path(&self, dir_name: &str) -> Option<PathBuf>
Get the model’s parent directory (without the version suffix).
Trait Implementations§
Source§impl Clone for ModelCacheLayout
impl Clone for ModelCacheLayout
Source§fn clone(&self) -> ModelCacheLayout
fn clone(&self) -> ModelCacheLayout
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ModelCacheLayout
impl Debug for ModelCacheLayout
Source§impl PartialEq for ModelCacheLayout
impl PartialEq for ModelCacheLayout
Source§fn eq(&self, other: &ModelCacheLayout) -> bool
fn eq(&self, other: &ModelCacheLayout) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for ModelCacheLayout
impl StructuralPartialEq for ModelCacheLayout
Auto Trait Implementations§
impl Freeze for ModelCacheLayout
impl RefUnwindSafe for ModelCacheLayout
impl Send for ModelCacheLayout
impl Sync for ModelCacheLayout
impl Unpin for ModelCacheLayout
impl UnsafeUnpin for ModelCacheLayout
impl UnwindSafe for ModelCacheLayout
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).