Trait mentat::vocabulary::VersionedStore [] [src]

pub trait VersionedStore: HasVocabularies + HasSchema {
    fn ensure_vocabulary(
        &mut self,
        definition: &Definition
    ) -> Result<VocabularyOutcome>;
fn ensure_vocabularies(
        &mut self,
        vocabularies: &mut VocabularySource
    ) -> Result<BTreeMap<Keyword, VocabularyOutcome>>; fn check_vocabulary<'definition>(
        &self,
        definition: &'definition Definition
    ) -> Result<VocabularyCheck<'definition>> { ... }
fn verify_core_schema(&self) -> Result<()> { ... } }

This trait captures the ability of a store to check and install/upgrade vocabularies.

Required Methods

Check whether the provided vocabulary is present in the store. If it isn't, make it so.

Check whether the provided vocabularies are present in the store at the correct version and with all defined attributes. If any are not, invoke the pre function on the provided VocabularySource, install or upgrade the necessary vocabularies, then invoke post. Returns Ok if all of these steps succeed.

Use this function instead of calling ensure_vocabulary if you need to have pre/post functions invoked when vocabulary changes are necessary.

Provided Methods

Check whether the vocabulary described by the provided metadata is present in the store.

Make sure that our expectations of the core vocabulary — basic types and attributes — are met.

Implementors