pub trait ValueGenerator:
Send
+ Sync
+ 'static {
// Required methods
fn exec(
&self,
ctx: &Context<'_, '_>,
value: &str,
mode: ValueGeneratorMode,
) -> Result<Box<dyn ValueRenderer>, Error>;
fn clone(&self) -> Box<dyn ValueGenerator>;
}Expand description
Trait that converts the value of a element specified in the XML schema to actual code.
You can add a custom default value implementation to your custom type using
CustomMeta::with_default.
Required Methods§
Sourcefn exec(
&self,
ctx: &Context<'_, '_>,
value: &str,
mode: ValueGeneratorMode,
) -> Result<Box<dyn ValueRenderer>, Error>
fn exec( &self, ctx: &Context<'_, '_>, value: &str, mode: ValueGeneratorMode, ) -> Result<Box<dyn ValueRenderer>, Error>
Try to convert the passed string value that contains the default value from
the XML schema to actual default code. If the value could not be converted
to code None is returned.
Sourcefn clone(&self) -> Box<dyn ValueGenerator>
fn clone(&self) -> Box<dyn ValueGenerator>
Clone this instance and return it as a box.