pub struct CacheManifest {
pub version: u32,
pub entries: HashMap<String, CacheManifestEntry>,
}Expand description
Cache manifest tracking all downloaded datasets.
Stored as manifest.json in the cache directory.
Enables:
- Reproducibility: know exactly what was downloaded
- Validation: verify checksums match
- Debugging: trace when data was fetched
Fields§
§version: u32Version of the manifest format.
entries: HashMap<String, CacheManifestEntry>Entries for each cached dataset.
Implementations§
Source§impl CacheManifest
impl CacheManifest
Sourcepub const CURRENT_VERSION: u32 = 1
pub const CURRENT_VERSION: u32 = 1
Current manifest format version.
Sourcepub fn load(cache_dir: &Path) -> Result<Self>
pub fn load(cache_dir: &Path) -> Result<Self>
Load manifest from a cache directory.
Returns empty manifest if file doesn’t exist.
Sourcepub fn update_entry(&mut self, entry: CacheManifestEntry)
pub fn update_entry(&mut self, entry: CacheManifestEntry)
Add or update an entry in the manifest.
Sourcepub fn get(&self, dataset_id: &str) -> Option<&CacheManifestEntry>
pub fn get(&self, dataset_id: &str) -> Option<&CacheManifestEntry>
Get entry for a dataset.
Sourcepub fn verify_entry(&self, dataset_id: &str, cache_dir: &Path) -> bool
pub fn verify_entry(&self, dataset_id: &str, cache_dir: &Path) -> bool
Check if a dataset’s cached file matches the manifest.
Returns true if the file exists and checksum matches.
Trait Implementations§
Source§impl Clone for CacheManifest
impl Clone for CacheManifest
Source§fn clone(&self) -> CacheManifest
fn clone(&self) -> CacheManifest
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 CacheManifest
impl Debug for CacheManifest
Source§impl Default for CacheManifest
impl Default for CacheManifest
Source§fn default() -> CacheManifest
fn default() -> CacheManifest
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for CacheManifest
impl<'de> Deserialize<'de> for CacheManifest
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CacheManifest
impl RefUnwindSafe for CacheManifest
impl Send for CacheManifest
impl Sync for CacheManifest
impl Unpin for CacheManifest
impl UnsafeUnpin for CacheManifest
impl UnwindSafe for CacheManifest
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
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