Trait mentat::vocabulary::VocabularySource
[−]
[src]
pub trait VocabularySource { fn definitions(&mut self) -> Vec<Definition>; fn pre(
&mut self,
_in_progress: &mut InProgress,
_checks: &VocabularyStatus
) -> Result<()> { ... } fn post(&mut self, _in_progress: &mut InProgress) -> Result<()> { ... } }
Implement VocabularySource
to have full programmatic control over how a set of Definition
s
are checked against and transacted into a store.
Required Methods
fn definitions(&mut self) -> Vec<Definition>
Called to obtain the list of Definition
s to install. This will be called before pre
.
Provided Methods
fn pre(
&mut self,
_in_progress: &mut InProgress,
_checks: &VocabularyStatus
) -> Result<()>
&mut self,
_in_progress: &mut InProgress,
_checks: &VocabularyStatus
) -> Result<()>
Called before the supplied Definition
s are transacted. Do not commit the InProgress
.
If this function returns Err
, the entire vocabulary operation will fail.
fn post(&mut self, _in_progress: &mut InProgress) -> Result<()>
Called after the supplied Definition
s are transacted. Do not commit the InProgress
.
If this function returns Err
, the entire vocabulary operation will fail.
Implementors
impl VocabularySource for SimpleVocabularySource