Struct git_config::fs::ConfigBuilder
source · [−]pub struct ConfigBuilder { /* private fields */ }
Implementations
sourceimpl ConfigBuilder
impl ConfigBuilder
sourcepub fn no_system(&mut self, no_system: bool) -> &mut Self
pub fn no_system(&mut self, no_system: bool) -> &mut Self
Whether or not to skip reading settings from the system-wide
$(prefix)/etc/gitconfig
file. This corresponds to setting the
GIT_CONFIG_NOSYSTEM
environment variable.
sourcepub fn load_environment_entries(&mut self, load_conf: bool) -> &mut Self
pub fn load_environment_entries(&mut self, load_conf: bool) -> &mut Self
Whether or not to respect GIT_CONFIG_COUNT
, GIT_CONFIG_KEY_<n>
, and
GIT_CONFIG_VALUE_<n>
environment variables. By default, this is true.
sourcepub fn system_config_path(&mut self, path: Option<PathBuf>) -> &mut Self
pub fn system_config_path(&mut self, path: Option<PathBuf>) -> &mut Self
Override the system-wide configuration file location. Providing None
or not calling this method will use the default location.
sourcepub fn global_config_path(&mut self, path: Option<PathBuf>) -> &mut Self
pub fn global_config_path(&mut self, path: Option<PathBuf>) -> &mut Self
Override the global (user) configuration file location. Providing
None
or not calling this method will use the default location.
sourcepub fn repository_config_path(&mut self, path: Option<PathBuf>) -> &mut Self
pub fn repository_config_path(&mut self, path: Option<PathBuf>) -> &mut Self
Sets where to read the repository-specific configuration file. This
is equivalent to setting GIT_CONFIG
. If none is provided, then the
builder will look in the default location, .git/config
.
sourcepub fn try_build(&self) -> Result<Config<'_>, ()>
pub fn try_build(&self) -> Result<Config<'_>, ()>
Attempts to build a config, returning error if the environment variable is invalid, if a config file is invalid, or if an overridden config file does not exist. This is only recommended when you have a very controlled system state. Otherwise, this will likely fail more often than you’d like.
Trait Implementations
sourceimpl Clone for ConfigBuilder
impl Clone for ConfigBuilder
sourcefn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ConfigBuilder
impl Debug for ConfigBuilder
sourceimpl Default for ConfigBuilder
impl Default for ConfigBuilder
sourcefn default() -> ConfigBuilder
fn default() -> ConfigBuilder
Returns the “default value” for a type. Read more
sourceimpl Hash for ConfigBuilder
impl Hash for ConfigBuilder
sourceimpl PartialEq<ConfigBuilder> for ConfigBuilder
impl PartialEq<ConfigBuilder> for ConfigBuilder
sourcefn eq(&self, other: &ConfigBuilder) -> bool
fn eq(&self, other: &ConfigBuilder) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &ConfigBuilder) -> bool
fn ne(&self, other: &ConfigBuilder) -> bool
This method tests for !=
.
impl Eq for ConfigBuilder
impl StructuralEq for ConfigBuilder
impl StructuralPartialEq for ConfigBuilder
Auto Trait Implementations
impl RefUnwindSafe for ConfigBuilder
impl Send for ConfigBuilder
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more