pub trait ConfigWrite {
    // Required methods
    fn set(
        &mut self,
        key: impl AsRef<str>,
        value: impl Into<ConfigValue>
    ) -> Result<()>;
    fn remove(&mut self, key: impl AsRef<str>) -> Result<()>;
    fn set_multivar(
        &mut self,
        key: impl AsRef<str>,
        regex: impl AsRef<str>,
        value: impl AsRef<str>
    ) -> Result<()>;
    fn remove_multivar(
        &mut self,
        key: impl AsRef<str>,
        regex: impl AsRef<str>
    ) -> Result<()>;
}
Expand description

Write-only interface to Git’s configuration.

Required Methods§

source

fn set( &mut self, key: impl AsRef<str>, value: impl Into<ConfigValue> ) -> Result<()>

Set the given config key to the given value.

source

fn remove(&mut self, key: impl AsRef<str>) -> Result<()>

Remove the given key from the configuration.

source

fn set_multivar( &mut self, key: impl AsRef<str>, regex: impl AsRef<str>, value: impl AsRef<str> ) -> Result<()>

Add or set a multivariable entry with the given to the given value. If a key-value pair whose value matches the provided regex already exists, that entry is overwritten.

source

fn remove_multivar( &mut self, key: impl AsRef<str>, regex: impl AsRef<str> ) -> Result<()>

Remove the multivariable entry with the provided key and whose value matches the provided regex. If such a key is not present, does nothing.

Implementors§