ConfigFactory

Trait ConfigFactory 

Source
pub trait ConfigFactory {
    // Required methods
    fn read_config(&mut self) -> Result<Rc<RefCell<Config>>, Error>;
    fn writer(self) -> Option<Box<dyn FnMut(&Config)>>;
}
Expand description

A factory able to source and (optionally) save Config

Required Methods§

Source

fn read_config(&mut self) -> Result<Rc<RefCell<Config>>, Error>

Construct a Config object

Returning an Error here will prevent startup of the UI. As such, it may be preferable to return Config::default() than to fail.

Source

fn writer(self) -> Option<Box<dyn FnMut(&Config)>>

Return optional config-writing fn

Implementors§