pub trait ConfigRead {
// Required methods
fn into_config(self) -> Config;
fn list<S: AsRef<str>>(
&self,
glob_pattern: S,
) -> Result<Vec<(String, String)>>;
fn get<V: GetConfigValue<V>, S: AsRef<str>>(
&self,
key: S,
) -> Result<Option<V>>;
// Provided methods
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§
Sourcefn 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§
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.