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§
Sourcefn read_config(&mut self) -> Result<Rc<RefCell<Config>>, Error>
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.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementors§
impl ConfigFactory for AutoFactory
impl ConfigFactory for DefaultFactory
impl ConfigFactory for ReadWriteFactory
Available on crate feature
serde only.