pub struct ConfigEnv { /* private fields */ }Implementations§
Source§impl ConfigEnv
impl ConfigEnv
Sourcepub fn from_environment(ui: &Ui) -> Self
pub fn from_environment(ui: &Ui) -> Self
Initializes configuration loader based on environment variables.
pub fn set_command_name(&mut self, command: String)
Sourcepub fn user_config_paths(&self) -> impl Iterator<Item = &Path>
pub fn user_config_paths(&self) -> impl Iterator<Item = &Path>
Returns the paths to the user-specific config files or directories.
Sourcepub fn existing_user_config_paths(&self) -> impl Iterator<Item = &Path>
pub fn existing_user_config_paths(&self) -> impl Iterator<Item = &Path>
Returns the paths to the existing user-specific config files or directories.
Sourcepub fn user_config_files(
&self,
config: &RawConfig,
) -> Result<Vec<ConfigFile>, ConfigLoadError>
pub fn user_config_files( &self, config: &RawConfig, ) -> Result<Vec<ConfigFile>, ConfigLoadError>
Returns user configuration files for modification. Instantiates one if
config has no user configuration layers.
The parent directory for the new file may be created by this function.
If the user configuration path is unknown, this function returns an
empty Vec.
Sourcepub fn reload_user_config(
&self,
config: &mut RawConfig,
) -> Result<(), ConfigLoadError>
pub fn reload_user_config( &self, config: &mut RawConfig, ) -> Result<(), ConfigLoadError>
Loads user-specific config files into the given config. The old
user-config layers will be replaced if any.
Sourcepub fn reset_repo_path(&mut self, path: &Path)
pub fn reset_repo_path(&mut self, path: &Path)
Sets the directory where repo-specific config file is stored. The path
is usually .jj/repo.
Sourcepub fn repo_config_path(&self) -> Option<&Path>
pub fn repo_config_path(&self) -> Option<&Path>
Returns a path to the repo-specific config file.
Sourcepub fn repo_config_files(
&self,
config: &RawConfig,
) -> Result<Vec<ConfigFile>, ConfigLoadError>
pub fn repo_config_files( &self, config: &RawConfig, ) -> Result<Vec<ConfigFile>, ConfigLoadError>
Returns repo configuration files for modification. Instantiates one if
config has no repo configuration layers.
If the repo path is unknown, this function returns an empty Vec. Since
the repo config path cannot be a directory, the returned Vec should
have at most one config file.
Sourcepub fn reload_repo_config(
&self,
config: &mut RawConfig,
) -> Result<(), ConfigLoadError>
pub fn reload_repo_config( &self, config: &mut RawConfig, ) -> Result<(), ConfigLoadError>
Loads repo-specific config file into the given config. The old
repo-config layer will be replaced if any.
Sourcepub fn reset_workspace_path(&mut self, path: &Path)
pub fn reset_workspace_path(&mut self, path: &Path)
Sets the directory for the workspace and the workspace-specific config file.
Sourcepub fn workspace_config_path(&self) -> Option<&Path>
pub fn workspace_config_path(&self) -> Option<&Path>
Returns a path to the workspace-specific config file.
Sourcepub fn workspace_config_files(
&self,
config: &RawConfig,
) -> Result<Vec<ConfigFile>, ConfigLoadError>
pub fn workspace_config_files( &self, config: &RawConfig, ) -> Result<Vec<ConfigFile>, ConfigLoadError>
Returns workspace configuration files for modification. Instantiates one
if config has no workspace configuration layers.
If the workspace path is unknown, this function returns an empty Vec.
Since the workspace config path cannot be a directory, the returned
Vec should have at most one config file.
Sourcepub fn reload_workspace_config(
&self,
config: &mut RawConfig,
) -> Result<(), ConfigLoadError>
pub fn reload_workspace_config( &self, config: &mut RawConfig, ) -> Result<(), ConfigLoadError>
Loads workspace-specific config file into the given config. The old
workspace-config layer will be replaced if any.
Sourcepub fn resolve_config(
&self,
config: &RawConfig,
) -> Result<StackedConfig, ConfigGetError>
pub fn resolve_config( &self, config: &RawConfig, ) -> Result<StackedConfig, ConfigGetError>
Resolves conditional scopes within the current environment. Returns new resolved config.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigEnv
impl RefUnwindSafe for ConfigEnv
impl Send for ConfigEnv
impl Sync for ConfigEnv
impl Unpin for ConfigEnv
impl UnwindSafe for ConfigEnv
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