pub struct Settings {Show 17 fields
pub additional_alias_args: Option<Vec<String>>,
pub additional_job_args: Vec<String>,
pub all_features: bool,
pub arg_job: Option<ConcreteJobRef>,
pub config_files: Vec<PathBuf>,
pub default_job: ConcreteJobRef,
pub exports: ExportsSettings,
pub features: Option<String>,
pub help_line: bool,
pub jobs: HashMap<String, Job>,
pub keybindings: KeyBindings,
pub no_default_features: bool,
pub reverse: bool,
pub summary: bool,
pub wrap: bool,
pub listen: bool,
pub all_jobs: Job,
}Expand description
The settings used in the application.
They’re immutable during the execution of the missions.
Fields§
§additional_alias_args: Option<Vec<String>>§additional_job_args: Vec<String>§all_features: bool§arg_job: Option<ConcreteJobRef>§config_files: Vec<PathBuf>Path of the files which were used to build the settings (note that not all settings come from files)
default_job: ConcreteJobRef§exports: ExportsSettings§features: Option<String>§help_line: bool§jobs: HashMap<String, Job>§keybindings: KeyBindings§no_default_features: bool§reverse: bool§summary: bool§wrap: bool§listen: boolWhether to listen for actions on a unix socket (if on unix)
all_jobs: JobImplementations§
Source§impl Settings
impl Settings
Sourcepub fn read(args: &Args, context: &Context) -> Result<Self>
pub fn read(args: &Args, context: &Context) -> Result<Self>
Read the settings from all configuration files and arguments.
Hardcoded defaults are overridden by the following configuration elements, in order:
- the default
bacon.tomlfile (embedded in the binary) - the global
prefs.toml, from user config directory - the file whose path is in environment variable
BACON_PREFS - the workspace.metadata.bacon config in the workspace level
Cargo.tomlfile - the workspace level
bacon.tomlfile in workspace-root/bacon.toml - the workspace level
bacon.tomlfile in workspace-root/.config/.bacon.toml - the package.metadata.bacon config in the package level
Cargo.tomlfile - the package level
bacon.tomlfile in package-root/.bacon.toml - the package level
bacon.tomlfile in package-root/.config/.bacon.toml - the file whose path is in environment variable
BACON_CONFIG - the content of the
--config-tomlargument - args given as arguments, coming from the cli call
pub fn register_config_file(&mut self, path: PathBuf)
Sourcepub fn apply_config(&mut self, config: &Config)
pub fn apply_config(&mut self, config: &Config)
Apply one of the configuration elements, overriding defaults and previously applied configuration elements
pub fn apply_args(&mut self, args: &Args)
pub fn check(&self) -> Result<()>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Settings
impl RefUnwindSafe for Settings
impl Send for Settings
impl Sync for Settings
impl Unpin for Settings
impl UnwindSafe for Settings
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more