pub struct BlindIndex { /* private fields */ }Expand description
A memory-mapped blind index.
Implementations§
Source§impl BlindIndex
impl BlindIndex
Sourcepub fn open(path: &Path) -> Result<Self>
pub fn open(path: &Path) -> Result<Self>
Map and check an index file. Cheap whatever the file’s size: see the module documentation for what is and is not checked here.
§Errors
ArcsecError::CatalogIo if the file cannot be opened, is not an index, is
another version or byte order, or its header is inconsistent.
Sourcepub fn validate(&self) -> Result<()>
pub fn validate(&self) -> Result<()>
Recompute every section checksum: a full read of the file.
§Errors
ArcsecError::CatalogIo naming the first section whose checksum differs.
Sourcepub fn n_patterns(&self) -> usize
pub fn n_patterns(&self) -> usize
Number of patterns, all tiers.
Sourcepub fn source_stamp(&self) -> SourceStamp
pub fn source_stamp(&self) -> SourceStamp
Fingerprint of the database the index was built from; not recorded
(SourceStamp::is_recorded false) in indexes built before it existed.
Sourcepub fn built_unix(&self) -> i64
pub fn built_unix(&self) -> i64
Build time, seconds since the Unix epoch.
Sourcepub fn tier_bytes(&self, t: &TierInfo) -> u64
pub fn tier_bytes(&self, t: &TierInfo) -> u64
Bytes of the file belonging to one tier’s patterns (keys and quads).
Sourcepub fn lookup(&self, tier: &TierInfo, key: u64) -> Range<usize> ⓘ
pub fn lookup(&self, tier: &TierInfo, key: u64) -> Range<usize> ⓘ
The patterns of tier whose key is exactly key.
Sourcepub fn quad(&self, i: usize) -> Option<[IndexStar; 4]>
pub fn quad(&self, i: usize) -> Option<[IndexStar; 4]>
The four stars of pattern i in canonical order; None if the pattern
index or any star index is out of range (a corrupt file).
Sourcepub fn stars_near(
&self,
ra: f64,
dec: f64,
radius: f64,
f: impl FnMut(&IndexStar),
)
pub fn stars_near( &self, ra: f64, dec: f64, radius: f64, f: impl FnMut(&IndexStar), )
Call f for every star within radius (radians) of (ra, dec), and a few
just outside it: candidates come from whole directory bands and a RA window
widened for the band’s declination, and the caller does the exact test.