Skip to main content

Store

Struct Store 

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

An opened artifact.

Implementations§

Source§

impl Store

Source

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.

Source

pub fn path(&self) -> &Path

The artifact’s path.

Source

pub fn meta(&self, key: &str) -> Result<Option<String>, StoreError>

An artifact-level fact by key.

§Errors

Returns StoreError when the database cannot be read.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for Store

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Store

§

impl !UnwindSafe for Store

§

impl Freeze for Store

§

impl Send for Store

§

impl Sync for Store

§

impl Unpin for Store

§

impl UnsafeUnpin for Store

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.