Skip to main content

BlindIndex

Struct BlindIndex 

Source
pub struct BlindIndex { /* private fields */ }
Expand description

A memory-mapped blind index.

Implementations§

Source§

impl BlindIndex

Source

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.

Source

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.

Source

pub fn tiers(&self) -> &[TierInfo]

Tiers, widest first.

Source

pub fn n_stars(&self) -> usize

Number of stars.

Source

pub fn n_patterns(&self) -> usize

Number of patterns, all tiers.

Source

pub fn source(&self) -> &str

Database the index was built from.

Source

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.

Source

pub fn built_unix(&self) -> i64

Build time, seconds since the Unix epoch.

Source

pub fn file_size(&self) -> usize

File size in bytes.

Source

pub fn tier_bytes(&self, t: &TierInfo) -> u64

Bytes of the file belonging to one tier’s patterns (keys and quads).

Source

pub fn lookup(&self, tier: &TierInfo, key: u64) -> Range<usize> ⓘ

The patterns of tier whose key is exactly key.

Source

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).

Source

pub fn star(&self, i: usize) -> Option<IndexStar>

Star i; None if out of range.

Source

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.

Trait Implementations§

Source§

impl Debug for BlindIndex

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.