Trait ConfigWrite

Source
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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§