Trait abscissa::LoadConfig [−][src]
pub trait LoadConfig<C: GlobalConfig> { fn config_path(&self) -> Option<PathBuf> { ... } fn load_global_config(&self) -> Result<(), FrameworkError> { ... } fn load_config_file<P: AsRef<CanonicalPath>>(
&self,
path: &P
) -> Result<C, FrameworkError> { ... } fn preprocess_config(&self, config: C) -> Result<C, FrameworkError> { ... } }
Support for loading configuration from a file. Does not modify the global configuration. Only handles parsing and deserializing it from files.
Provided Methods
fn config_path(&self) -> Option<PathBuf>
Path to the command's configuration file. Returns an error by default.
fn load_global_config(&self) -> Result<(), FrameworkError>
Load the configuration from self.config_path()
if present
fn load_config_file<P: AsRef<CanonicalPath>>(
&self,
path: &P
) -> Result<C, FrameworkError>
&self,
path: &P
) -> Result<C, FrameworkError>
Load the configuration for this command
fn preprocess_config(&self, config: C) -> Result<C, FrameworkError>
Process the configuration after it has been loaded, potentially modifying it or returning an error if options are incompatible