CustomDefaultImpl

Trait CustomDefaultImpl 

Source
pub trait CustomDefaultImpl:
    Send
    + Sync
    + 'static {
    // Required methods
    fn exec(&self, s: &str) -> Option<TokenStream>;
    fn clone(&self) -> Box<dyn CustomDefaultImpl>;
}
Expand description

Trait that converts the default value of a element specified in the XML schema to actual default code.

You can add a custom default implementation to your custom type using CustomMeta::with_default.

Required Methods§

Source

fn exec(&self, s: &str) -> Option<TokenStream>

Try to convert the passed string s 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.

Source

fn clone(&self) -> Box<dyn CustomDefaultImpl>

Clone this instance and return it as a box.

Implementors§

Source§

impl<X> CustomDefaultImpl for X
where X: Fn(&str) -> Option<TokenStream> + Clone + Send + Sync + 'static,