Trait branchless::git::ConfigRead [−][src]
pub trait ConfigRead {
fn into_config(self) -> Config;
fn get<V: GetConfigValue<V>, S: AsRef<str>>(
&self,
key: S
) -> Result<Option<V>>;
fn get_or<V: GetConfigValue<V>, S: AsRef<str>>(
&self,
key: S,
default: V
) -> Result<V> { ... }
fn get_or_else<V: GetConfigValue<V>, S: AsRef<str>, F: FnOnce() -> V>(
&self,
key: S,
default: F
) -> Result<V> { ... }
}
Expand description
Read-only interface to Git’s configuration.
Required methods
fn into_config(self) -> Config
fn into_config(self) -> Config
Convert this object into an owned, writable version of the configuration. You should only use this if you know that it’s safe to write to the underlying configuration file.
Provided methods
Same as get
, but uses a default value if the config key doesn’t exist.