pub struct ConfigSet { /* private fields */ }Expand description
Ordered entries; later entries override earlier ones for single-valued reads.
Implementations§
Source§impl ConfigSet
impl ConfigSet
pub fn new() -> Self
Sourcepub fn load(git_dir: Option<&Path>) -> Self
pub fn load(git_dir: Option<&Path>) -> Self
Load system, global, optional repository config, then env and
GIT_CONFIG_PARAMETERS. Unreadable or malformed files are skipped
(callers that must surface parse errors use ConfigSet::add_file).
Sourcepub fn load_discovered(start: &Path) -> Self
pub fn load_discovered(start: &Path) -> Self
Load with the repository found by walking up from start (or GIT_DIR).
pub fn push(&mut self, key: String, value: Option<String>, scope: ConfigScope)
Sourcepub fn add_file(
&mut self,
path: &Path,
scope: ConfigScope,
) -> Result<(), String>
pub fn add_file( &mut self, path: &Path, scope: ConfigScope, ) -> Result<(), String>
Parse path and append its entries (following include.path).
pub fn entries(&self) -> &[ConfigEntry]
Sourcepub fn get_all(&self, key: &str) -> Vec<String>
pub fn get_all(&self, key: &str) -> Vec<String>
All values for a multi-valued key, in precedence order.
pub fn get_bool(&self, key: &str) -> Option<bool>
Trait Implementations§
Auto Trait Implementations§
impl Forget for ConfigSet
impl Freeze for ConfigSet
impl Move for ConfigSet
impl RefUnwindSafe for ConfigSet
impl Send for ConfigSetwhere
RawVecInner: Send,
impl Sync for ConfigSetwhere
RawVecInner: Sync,
impl Unpin for ConfigSet
impl UnsafeUnpin for ConfigSet
impl UnwindSafe for ConfigSetwhere
RawVecInner: UnwindSafe,
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
Mutably borrows from an owned value. Read more