Struct git_config::fs::Config
source · [−]pub struct Config<'config> { /* private fields */ }
Implementations
sourceimpl<'config> Config<'config>
impl<'config> Config<'config>
pub fn value<T: TryFrom<Cow<'config, [u8]>>>(
&'config self,
section_name: &str,
subsection_name: Option<&str>,
key: &str
) -> Option<T>
pub fn try_value<'lookup, T: TryFrom<Cow<'config, [u8]>>>(
&'config self,
section_name: &'lookup str,
subsection_name: Option<&'lookup str>,
key: &'lookup str
) -> Result<Option<T>, GitConfigError<'lookup>>
sourcepub fn try_value_with_source<'lookup, T: TryFrom<Cow<'config, [u8]>>>(
&'config self,
section_name: &'lookup str,
subsection_name: Option<&'lookup str>,
key: &'lookup str
) -> Result<Option<(T, ConfigSource)>, GitConfigError<'lookup>>
pub fn try_value_with_source<'lookup, T: TryFrom<Cow<'config, [u8]>>>(
&'config self,
section_name: &'lookup str,
subsection_name: Option<&'lookup str>,
key: &'lookup str
) -> Result<Option<(T, ConfigSource)>, GitConfigError<'lookup>>
Tries to retrieve the value, returning an error if the parsing fails or if the key was not found. On a successful parse, the value will be returned as well as the source location. This respects the priority of the various configuration files.
sourceimpl<'config> Config<'config>
impl<'config> Config<'config>
Lower-level interface for directly accessing a
sourcepub fn get_config(&self, source: ConfigSource) -> Option<&GitConfig<'config>>
pub fn get_config(&self, source: ConfigSource) -> Option<&GitConfig<'config>>
Retrieves the underlying GitConfig
object, if one was found during
initialization.
sourcepub fn get_config_mut(
&mut self,
source: ConfigSource
) -> Option<&mut GitConfig<'config>>
pub fn get_config_mut(
&mut self,
source: ConfigSource
) -> Option<&mut GitConfig<'config>>
Retrieves the underlying GitConfig
object as a mutable reference,
if one was found during initialization.
Auto Trait Implementations
impl<'config> RefUnwindSafe for Config<'config>
impl<'config> Send for Config<'config>
impl<'config> Sync for Config<'config>
impl<'config> Unpin for Config<'config>
impl<'config> UnwindSafe for Config<'config>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more