pub struct Store { /* private fields */ }Expand description
An opened artifact.
Implementations§
Source§impl Store
impl Store
Sourcepub fn open(path: &Path) -> Result<Self, StoreError>
pub fn open(path: &Path) -> Result<Self, StoreError>
Opens the artifact at path read-only and checks its layout version.
§Errors
Returns StoreError when the file cannot be opened, is not an
artifact of this layout, or a table is missing.
Sourcepub fn ordinal(&self, code: &str) -> Result<Option<Ordinal>, StoreError>
pub fn ordinal(&self, code: &str) -> Result<Option<Ordinal>, StoreError>
The ordinal of a native code, if the version has it.
§Errors
Returns StoreError when the database cannot be read.
Sourcepub fn concept(&self, ordinal: Ordinal) -> Result<Option<Concept>, StoreError>
pub fn concept(&self, ordinal: Ordinal) -> Result<Option<Concept>, StoreError>
The concept at ordinal, if any.
§Errors
Returns StoreError when the database cannot be read or the record is damaged.
Sourcepub fn designations(
&self,
ordinal: Ordinal,
) -> Result<Vec<Designation>, StoreError>
pub fn designations( &self, ordinal: Ordinal, ) -> Result<Vec<Designation>, StoreError>
Every designation of ordinal, in index order.
§Errors
Returns StoreError when the database cannot be read or a record is damaged.
Sourcepub fn acceptability(
&self,
ordinal: Ordinal,
designation: u32,
language_refset: u32,
) -> Result<Option<u32>, StoreError>
pub fn acceptability( &self, ordinal: Ordinal, designation: u32, language_refset: u32, ) -> Result<Option<u32>, StoreError>
The acceptability ordinal of a designation in a language reference set.
§Errors
Returns StoreError when the database cannot be read.
Sourcepub fn preferred(
&self,
ordinal: Ordinal,
language_refset: u32,
use_ordinal: u32,
) -> Result<Option<Designation>, StoreError>
pub fn preferred( &self, ordinal: Ordinal, language_refset: u32, use_ordinal: u32, ) -> Result<Option<Designation>, StoreError>
The preferred designation of ordinal for a language reference set and
designation use, as the build precomputed it.
§Errors
Returns StoreError when the database cannot be read or the record is damaged.
Sourcepub fn properties(
&self,
ordinal: Ordinal,
) -> Result<Vec<(u32, Vec<PropertyValue>)>, StoreError>
pub fn properties( &self, ordinal: Ordinal, ) -> Result<Vec<(u32, Vec<PropertyValue>)>, StoreError>
Every property of ordinal, as (property key ordinal, values), in key order.
§Errors
Returns StoreError when the database cannot be read or a record is damaged.
Sourcepub fn vocabulary(
&self,
kind: Vocabulary,
ordinal: u32,
) -> Result<Option<String>, StoreError>
pub fn vocabulary( &self, kind: Vocabulary, ordinal: u32, ) -> Result<Option<String>, StoreError>
A vocabulary entry: the name of a property key, designation use, language reference set, or acceptability ordinal.
§Errors
Returns StoreError when the database cannot be read.
Sourcepub fn vocabulary_ordinal(
&self,
kind: Vocabulary,
name: &str,
) -> Result<Option<u32>, StoreError>
pub fn vocabulary_ordinal( &self, kind: Vocabulary, name: &str, ) -> Result<Option<u32>, StoreError>
The ordinal of a vocabulary name, by scanning the (small) vocabulary table.
§Errors
Returns StoreError when the database cannot be read.