pub struct XvcLoadParams {
pub current_dir: AbsolutePath,
pub xvc_root_dir: Option<AbsolutePath>,
pub include_system_config: bool,
pub include_user_config: bool,
pub include_project_config: bool,
pub include_local_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§
§current_dir: AbsolutePathThe directory where the application runs. This can be set by various Options. It affects how paths are handled in general.
xvc_root_dir: Option<AbsolutePath>This is Some(dir) if we run in an Xvc directory Guid will be read from here in version 2 onwards
include_system_config: boolShould we include system configuration?
If true, it’s read from [SYSTEM_CONFIG_DIRS].
include_user_config: boolShould the user’s (home) config be included.
If true, it’s read from [USER_CONFIG_DIRS].
include_project_config: boolShould we include the project config at .xvc/config.toml?
include_local_config: boolShould we include the local config at .xvc/config-local.toml
project_config_path: Option<AbsolutePath>Where should we load the project’s (public) configuration? It’s loaded in [XvcRootInner::new]
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: boolShould 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 XvcLoadParams
impl XvcLoadParams
Sourcepub fn new(
current_dir: AbsolutePath,
xvc_root_dir: Option<AbsolutePath>,
) -> XvcLoadParams
pub fn new( current_dir: AbsolutePath, xvc_root_dir: Option<AbsolutePath>, ) -> XvcLoadParams
Create a new blank config params
Sourcepub fn include_system_config(self, include_system_config: bool) -> XvcLoadParams
pub fn include_system_config(self, include_system_config: bool) -> XvcLoadParams
Update include_system_config value
Sourcepub fn include_user_config(self, include_user_config: bool) -> XvcLoadParams
pub fn include_user_config(self, include_user_config: bool) -> XvcLoadParams
Update include_user_config value
Sourcepub fn project_config_path(
self,
project_config_path: Option<AbsolutePath>,
) -> XvcLoadParams
pub fn project_config_path( self, project_config_path: Option<AbsolutePath>, ) -> XvcLoadParams
Update project config path
Sourcepub fn local_config_path(
self,
local_config_path: Option<AbsolutePath>,
) -> XvcLoadParams
pub fn local_config_path( self, local_config_path: Option<AbsolutePath>, ) -> XvcLoadParams
Update local config path
Sourcepub fn include_environment_config(
self,
include_environment_config: bool,
) -> XvcLoadParams
pub fn include_environment_config( self, include_environment_config: bool, ) -> XvcLoadParams
Whether to include enviroment variables in the configuration
Sourcepub fn command_line_config(
self,
command_line_config: Option<Vec<String>>,
) -> XvcLoadParams
pub fn command_line_config( self, command_line_config: Option<Vec<String>>, ) -> XvcLoadParams
Command line config from key=value definitions
Trait Implementations§
Source§impl Clone for XvcLoadParams
impl Clone for XvcLoadParams
Source§fn clone(&self) -> XvcLoadParams
fn clone(&self) -> XvcLoadParams
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 XvcLoadParams
impl RefUnwindSafe for XvcLoadParams
impl Send for XvcLoadParams
impl Sync for XvcLoadParams
impl Unpin for XvcLoadParams
impl UnwindSafe for XvcLoadParams
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