pub struct ModelStore { /* private fields */ }Implementations§
Source§impl ModelStore
impl ModelStore
pub fn new(dir: impl Into<PathBuf>) -> Self
Sourcepub fn from_env() -> Self
pub fn from_env() -> Self
$WEIRDNET_MODELS_DIR, else <user data dir>/weirdnet/models; the Hub from
$WEIRDNET_HF_URL (a mirror) when set.
Sourcepub fn with_hub(self, hub: impl Into<String>) -> Self
pub fn with_hub(self, hub: impl Into<String>) -> Self
Use another Hub (a mirror, or a local server in tests).
pub fn dir(&self) -> &Path
pub fn hub(&self) -> &str
Sourcepub fn installed(&self, spec: &ModelSpec) -> bool
pub fn installed(&self, spec: &ModelSpec) -> bool
Downloaded and complete: the size matches (the checksum was checked when it finished).
Sourcepub fn partial_bytes(&self, spec: &ModelSpec) -> u64
pub fn partial_bytes(&self, spec: &ModelSpec) -> u64
Bytes of a partial download, if any.
Trait Implementations§
Source§impl Clone for ModelStore
impl Clone for ModelStore
Source§impl Debug for ModelStore
impl Debug for ModelStore
impl Eq for ModelStore
Source§impl PartialEq for ModelStore
impl PartialEq for ModelStore
impl StructuralPartialEq for ModelStore
Auto Trait Implementations§
impl Forget for ModelStore
impl Freeze for ModelStore
impl Move for ModelStore
impl RefUnwindSafe for ModelStore
impl Send for ModelStore
impl Sync for ModelStore
impl Unpin for ModelStore
impl UnsafeUnpin for ModelStore
impl UnwindSafe for ModelStore
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