pub trait FromConfig {
// Required method
fn from_config(conf: &XvcConfiguration) -> Result<Box<Self>, Error>;
}Expand description
Trait to update CLI options with defaults from configuration.
When a CLI struct like [xvc_pipeline::PipelineCLI] implements this trait, it reads the configuration and updates values not set in the command line accordingly.
Required Methods§
Sourcefn from_config(conf: &XvcConfiguration) -> Result<Box<Self>, Error>
fn from_config(conf: &XvcConfiguration) -> Result<Box<Self>, Error>
Update the implementing struct from the configuration. Reading the relevant keys and values of the config is in implementor’s responsibility.
This is used to abstract away CLI structs and crate options.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.