pub struct ConfigSet { /* private fields */ }Expand description
A merged view across all configuration scopes.
Entries are stored in file-order within each scope; scopes are layered in priority order (system < global < local < worktree < command).
Implementations§
Source§impl ConfigSet
impl ConfigSet
Sourcepub fn entries(&self) -> &[ConfigEntry]
pub fn entries(&self) -> &[ConfigEntry]
All merged entries in load order (for listing keys such as alias.*).
Sourcepub fn merge(&mut self, file: &ConfigFile)
pub fn merge(&mut self, file: &ConfigFile)
Merge entries from a ConfigFile into this set.
Entries are appended; later values override earlier ones for single-value lookups.
Sourcepub fn add_command_override(&mut self, key: &str, value: &str) -> Result<()>
pub fn add_command_override(&mut self, key: &str, value: &str) -> Result<()>
Add a command-line override (-c key=value).
Sourcepub fn get_all(&self, key: &str) -> Vec<String>
pub fn get_all(&self, key: &str) -> Vec<String>
Get all values for a key (multi-valued; in load order).
Sourcepub fn get_bool(&self, key: &str) -> Option<Result<bool, String>>
pub fn get_bool(&self, key: &str) -> Option<Result<bool, String>>
Get a boolean value, interpreting true/yes/on/1 as true and
false/no/off/0 as false.
Sourcepub fn get_i64(&self, key: &str) -> Option<Result<i64, String>>
pub fn get_i64(&self, key: &str) -> Option<Result<i64, String>>
Get an integer value, supporting Git’s k/m/g suffixes.
Sourcepub fn get_regexp(&self, pattern: &str) -> Result<Vec<&ConfigEntry>, String>
pub fn get_regexp(&self, pattern: &str) -> Result<Vec<&ConfigEntry>, String>
Get all entries matching a key pattern (regex).
Used by git config --get-regexp. Returns an error if the pattern
is not a valid regex.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConfigSet
impl RefUnwindSafe for ConfigSet
impl Send for ConfigSet
impl Sync for ConfigSet
impl Unpin for ConfigSet
impl UnsafeUnpin for ConfigSet
impl UnwindSafe for ConfigSet
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