Struct mentat::vocabulary::SimpleVocabularySource
[−]
[src]
pub struct SimpleVocabularySource { pub definitions: Vec<Definition>, pub pre: Option<fn(_: &mut InProgress) -> Result<()>>, pub post: Option<fn(_: &mut InProgress) -> Result<()>>, }
A convenience struct to package simple pre
and post
functions with a collection of
vocabulary Definition
s.
Fields
definitions: Vec<Definition>
pre: Option<fn(_: &mut InProgress) -> Result<()>>
post: Option<fn(_: &mut InProgress) -> Result<()>>
Methods
impl SimpleVocabularySource
[src]
impl SimpleVocabularySource
pub fn new(
definitions: Vec<Definition>,
pre: Option<fn(_: &mut InProgress) -> Result<()>>,
post: Option<fn(_: &mut InProgress) -> Result<()>>
) -> SimpleVocabularySource
[src]
pub fn new(
definitions: Vec<Definition>,
pre: Option<fn(_: &mut InProgress) -> Result<()>>,
post: Option<fn(_: &mut InProgress) -> Result<()>>
) -> SimpleVocabularySource
pub fn with_definitions(definitions: Vec<Definition>) -> SimpleVocabularySource
[src]
pub fn with_definitions(definitions: Vec<Definition>) -> SimpleVocabularySource
Trait Implementations
impl VocabularySource for SimpleVocabularySource
[src]
impl VocabularySource for SimpleVocabularySource
fn pre(
&mut self,
in_progress: &mut InProgress,
_checks: &VocabularyStatus
) -> Result<()>
[src]
fn pre(
&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. Read more
fn post(&mut self, in_progress: &mut InProgress) -> Result<()>
[src]
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. Read more
fn definitions(&mut self) -> Vec<Definition>
[src]
fn definitions(&mut self) -> Vec<Definition>
Called to obtain the list of Definition
s to install. This will be called before pre
.
Auto Trait Implementations
impl Send for SimpleVocabularySource
impl Send for SimpleVocabularySource
impl Sync for SimpleVocabularySource
impl Sync for SimpleVocabularySource