pub struct CacheReport {
pub model_id: String,
pub repo: String,
pub precision: Option<Precision>,
pub cache_dir: PathBuf,
pub files: BTreeMap<String, Option<PathBuf>>,
pub cached: bool,
pub snapshot_path: Option<PathBuf>,
pub disk_usage_bytes: u64,
}Expand description
Offline answer to “is this model already cached, and where?” — built
by cache_info without a session, a download, or a device probe.
Fields§
§model_id: StringModel id exactly as passed in.
repo: StringArtifact repo actually used — may differ from model_id (the
default id at fp16 resolves to the FP16 mirror).
precision: Option<Precision>Resolved precision tier for registry lookups (cache_info sets
Some; auto is refused). None for the generic
cache_info_files lookup, which has no precision tier.
cache_dir: PathBufEffective hub cache directory (override or env-resolved default).
files: BTreeMap<String, Option<PathBuf>>One entry per probed file — the artifact model file, its external-
data sidecar when the layout has one, and tokenizer.json.
None = not present in this cache.
cached: boolTrue when open() would succeed offline: model file + tokenizer
both present (a missing sidecar only warns at open, so it keeps
cached true).
snapshot_path: Option<PathBuf>Snapshot directory holding the present files
(<cache>/models--{owner}--{name}/snapshots/<sha>), when known.
disk_usage_bytes: u64Sum of on-disk sizes of the present files (snapshot pointers are followed to their blobs).
Trait Implementations§
Source§impl Clone for CacheReport
impl Clone for CacheReport
Auto Trait Implementations§
impl Freeze for CacheReport
impl RefUnwindSafe for CacheReport
impl Send for CacheReport
impl Sync for CacheReport
impl Unpin for CacheReport
impl UnsafeUnpin for CacheReport
impl UnwindSafe for CacheReport
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> DropFlavorWrapper<T> for T
impl<T> DropFlavorWrapper<T> for T
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
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> ⓘ
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> ⓘ
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