Skip to main content

NumericStore

Struct NumericStore 

Source
pub struct NumericStore {
Show 16 fields pub ids: Vec<u64>, pub modules: Vec<u32>, pub effective_times: Vec<u32>, pub flags: Vec<u8>, pub parents: Adjacency, pub children: Adjacency, pub attributes: Attributes, pub concrete: Attributes, pub concrete_values: Vec<ConcreteValue>, pub membership: Option<MembershipIndex>, pub descriptions: DescriptionStore, pub search: SearchStore, pub history: HistoryStore, pub member_tables: MemberStore, pub identifiers: IdentifierStore, pub config: QueryConfig,
}

Fields§

§ids: Vec<u64>§modules: Vec<u32>§effective_times: Vec<u32>§flags: Vec<u8>

Bit 0: active. Bit 1: fully defined.

§parents: Adjacency§children: Adjacency§attributes: Attributes§concrete: Attributes§concrete_values: Vec<ConcreteValue>§membership: Option<MembershipIndex>

Active refset member rows referencing concepts. None means the index was not built.

§descriptions: DescriptionStore§search: SearchStore§history: HistoryStore§member_tables: MemberStore§identifiers: IdentifierStore§config: QueryConfig

Implementations§

Source§

impl NumericStore

Source

pub fn ordinal(&self, sctid: u64) -> Option<u32>

Source

pub fn is_active(&self, ordinal: u32) -> bool

Source

pub fn hierarchy( &self, sctid: u64, ancestors: bool, direct: bool, include_self: bool, ) -> Vec<u64>

Returns numeric-sorted SCTIDs through active edges, including an inactive self if requested.

Source

pub fn validate_bounds(&self) -> Result<()>

Checks that every stored index stays inside its own arrays.

Opening a store runs only these. They are what later evaluation relies on to index safely; the semantic invariants in validate were proved when the index was written, and the section checksum already shows the bytes are the same ones.

Source

pub fn validate(&self) -> Result<()>

Checks the bounds above and then every semantic invariant: ordering, that the two hierarchy directions agree, that the graph is acyclic, and that active rows reference active concepts.

Import runs this before publishing an index and verify runs it on demand. Opening a store does not, because re-deriving these properties on every process start costs more than it protects: the checksum detects the corruption they would otherwise catch.

Source

pub fn write(&self, path: &Path) -> Result<()>

Source

pub fn open(directory: &Path) -> Result<Self>

Trait Implementations§

Source§

impl Debug for NumericStore

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for NumericStore

Source§

fn default() -> Self

Returns the “default value” for a type. 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> Same for T

Source§

type Output = T

Should always be Self
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.