pub struct ConfigEnv { /* private fields */ }Implementations§
Source§impl ConfigEnv
impl ConfigEnv
Sourcepub fn from_environment() -> Result<Self, ConfigEnvError>
pub fn from_environment() -> Result<Self, ConfigEnvError>
Initializes configuration loader based on environment variables.
Sourcepub fn existing_user_config_path(&self) -> Option<&Path>
pub fn existing_user_config_path(&self) -> Option<&Path>
Returns a path to the existing user-specific config file or directory.
Sourcepub fn new_user_config_path(&self) -> Result<Option<&Path>, ConfigEnvError>
pub fn new_user_config_path(&self) -> Result<Option<&Path>, ConfigEnvError>
Returns a path to the user-specific config file.
If no config file is found, tries to guess a reasonable new location for it. If a path to a new config file is returned, the parent directory may be created as a result of this call.
Sourcepub fn reload_user_config(
&self,
config: &mut StackedConfig,
) -> Result<(), ConfigError>
pub fn reload_user_config( &self, config: &mut StackedConfig, ) -> Result<(), ConfigError>
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 existing_repo_config_path(&self) -> Option<&Path>
pub fn existing_repo_config_path(&self) -> Option<&Path>
Returns a path to the existing repo-specific config file.
Sourcepub fn new_repo_config_path(&self) -> Option<&Path>
pub fn new_repo_config_path(&self) -> Option<&Path>
Returns a path to the repo-specific config file.
Sourcepub fn reload_repo_config(
&self,
config: &mut StackedConfig,
) -> Result<(), ConfigError>
pub fn reload_repo_config( &self, config: &mut StackedConfig, ) -> Result<(), ConfigError>
Loads repo-specific config file into the given config. The old
repo-config layer will be replaced if any.
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