pub struct YcdIndexEntry {
pub path: PathBuf,
pub data_offset: u64,
pub file_start: usize,
pub file_length: usize,
pub file_size: u64,
pub modified: SystemTime,
}Expand description
One entry in a YcdIndex, representing a single YCD file.
The snapshot fields (file_size, modified) are recorded at index-build
time and compared against the filesystem when a file is actually read.
Any mismatch causes read_digits to return an explicit “stale index” error
rather than silently reading potentially incorrect data.
Fields§
§path: PathBufAbsolute path to the YCD file.
data_offset: u64Byte offset at which compressed 8-byte blocks start.
file_start: usize1-based absolute digit position of this file’s first digit.
file_length: usizeTotal number of digits stored in this file.
file_size: u64File size in bytes recorded at index-build time.
modified: SystemTimeLast-modified time recorded at index-build time.
On platforms where std::fs::Metadata::modified() is unavailable,
this field is set to SystemTime::UNIX_EPOCH at build time and
read_digits will also read UNIX_EPOCH for the current mtime,
so the comparison will always succeed. On those platforms stale-index
detection relies solely on file_size.
Trait Implementations§
Source§impl Clone for YcdIndexEntry
impl Clone for YcdIndexEntry
Source§fn clone(&self) -> YcdIndexEntry
fn clone(&self) -> YcdIndexEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more