pub struct ConfigOverride { /* private fields */ }Expand description
One command-line configuration override, the key[=value] argument of git -c.
Parse one with str::parse (or ConfigOverride::new) and apply it with
Environment::push_config_override. The key is validated like any config key
(section[.subsection].name); a bare key with no = sets the boolean value true,
and key= sets the empty string.
Implementations§
Source§impl ConfigOverride
impl ConfigOverride
Sourcepub fn new(key: impl Into<String>, value: Option<String>) -> Result<Self>
pub fn new(key: impl Into<String>, value: Option<String>) -> Result<Self>
Build an override from a key and optional value.
§Parameters
key: config key such asuser.nameorremote.origin.url.value: the value to set, orNonefor a booleantrue(bare key).
§Errors
Returns crate::error::Error::Config when key is not a valid config key.
Trait Implementations§
Source§impl Clone for ConfigOverride
impl Clone for ConfigOverride
Source§impl Debug for ConfigOverride
impl Debug for ConfigOverride
impl Eq for ConfigOverride
Source§impl FromStr for ConfigOverride
impl FromStr for ConfigOverride
Source§impl PartialEq for ConfigOverride
impl PartialEq for ConfigOverride
impl StructuralPartialEq for ConfigOverride
Auto Trait Implementations§
impl Freeze for ConfigOverride
impl RefUnwindSafe for ConfigOverride
impl Send for ConfigOverride
impl Sync for ConfigOverride
impl Unpin for ConfigOverride
impl UnsafeUnpin for ConfigOverride
impl UnwindSafe for ConfigOverride
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.