pub struct SourceStamp {
pub files: u32,
pub bytes: u64,
pub hash: u64,
}Expand description
Which copy of a star database an index was built from, so a later check can tell whether the database has changed since (a new ASTAP release, a re-download, a different directory’s files).
The fingerprint covers each database file’s name, size and first
SourceStamp::HEAD_BYTES bytes, not its modification time: copying a database
to another disk changes every mtime without changing a star. All zero when not
recorded (indexes built before the stamp existed).
Fields§
§files: u32Number of database files.
bytes: u64Their total size in bytes.
hash: u64FNV-1a over every file’s name, size and head, in name order.
Implementations§
Source§impl SourceStamp
impl SourceStamp
Sourcepub const HEAD_BYTES: usize = 4096
pub const HEAD_BYTES: usize = 4096
Bytes of each file’s head folded into the hash.
Sourcepub fn is_recorded(&self) -> bool
pub fn is_recorded(&self) -> bool
Whether the index recorded its source at all.
Sourcepub fn of_database(db_path: &Path, db_name: &str) -> Result<Self>
pub fn of_database(db_path: &Path, db_name: &str) -> Result<Self>
Fingerprint the files of database db_name in db_path: every
<db_name>_*.{1476,290,001}. Reads a few kilobytes per file.
§Errors
ArcsecError::CatalogIo if the directory or a file cannot be read.