pub struct XvcConfigParams {
pub default_configuration: String,
pub current_dir: AbsolutePath,
pub include_system_config: bool,
pub include_user_config: bool,
pub project_config_path: Option<AbsolutePath>,
pub local_config_path: Option<AbsolutePath>,
pub include_environment_config: bool,
pub command_line_config: Option<Vec<String>>,
}
Expand description
How should we initialize the configuration?
It’s possible to ignore certain sources by supplying None
to their values here.
Fields§
§default_configuration: String
The default configuration for the project. It should contain all default values as a TOML document. Xvc produces this in [xvc_core::default_configuration].
current_dir: AbsolutePath
The directory where the application runs. This can be set by various Options. It affects how paths are handled in general.
include_system_config: bool
Should we include system configuration?
If true
, it’s read from [SYSTEM_CONFIG_DIRS].
include_user_config: bool
Should the user’s (home) config be included.
If true
, it’s read from [USER_CONFIG_DIRS].
project_config_path: Option<AbsolutePath>
Where should we load the project’s (public) configuration? It’s loaded in [XvcRootInner::new] TODO: Add a option to ignore this
local_config_path: Option<AbsolutePath>
Where should we load the project’s (private) configuration? It’s loaded in [XvcRootInner::new] TODO: Add a option to ignore this
include_environment_config: bool
Should we include configuration from the environment.
If true
, look for all variables in the form
XVC_group.key=value
from the environment and put them into the configuration.
command_line_config: Option<Vec<String>>
Command line configuration
Implementations§
Source§impl XvcConfigParams
impl XvcConfigParams
Sourcepub fn new(
default_configuration: String,
current_dir: AbsolutePath,
) -> XvcConfigParams
pub fn new( default_configuration: String, current_dir: AbsolutePath, ) -> XvcConfigParams
Create a new blank config params
Sourcepub fn include_system_config(
self,
include_system_config: bool,
) -> XvcConfigParams
pub fn include_system_config( self, include_system_config: bool, ) -> XvcConfigParams
Update include_system_config value
Sourcepub fn include_user_config(self, include_user_config: bool) -> XvcConfigParams
pub fn include_user_config(self, include_user_config: bool) -> XvcConfigParams
Update include_user_config value
Sourcepub fn project_config_path(
self,
project_config_path: Option<AbsolutePath>,
) -> XvcConfigParams
pub fn project_config_path( self, project_config_path: Option<AbsolutePath>, ) -> XvcConfigParams
Update project config path
Sourcepub fn local_config_path(
self,
local_config_path: Option<AbsolutePath>,
) -> XvcConfigParams
pub fn local_config_path( self, local_config_path: Option<AbsolutePath>, ) -> XvcConfigParams
Update local config path
Sourcepub fn include_environment_config(
self,
include_environment_config: bool,
) -> XvcConfigParams
pub fn include_environment_config( self, include_environment_config: bool, ) -> XvcConfigParams
Whether to include enviroment variables in the configuration
Sourcepub fn command_line_config(
self,
command_line_config: Option<Vec<String>>,
) -> XvcConfigParams
pub fn command_line_config( self, command_line_config: Option<Vec<String>>, ) -> XvcConfigParams
Command line config from key=value definitions
Trait Implementations§
Source§impl Clone for XvcConfigParams
impl Clone for XvcConfigParams
Source§fn clone(&self) -> XvcConfigParams
fn clone(&self) -> XvcConfigParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for XvcConfigParams
impl RefUnwindSafe for XvcConfigParams
impl Send for XvcConfigParams
impl Sync for XvcConfigParams
impl Unpin for XvcConfigParams
impl UnwindSafe for XvcConfigParams
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more