Struct git_config::fs::Config
source · [−]pub struct Config<'a> { /* private fields */ }
Implementations
sourceimpl<'a> Config<'a>
impl<'a> Config<'a>
pub fn value<T: TryFrom<Cow<'a, [u8]>>>(
&'a self,
section_name: &str,
subsection_name: Option<&str>,
key: &str
) -> Option<T>
pub fn try_value<'lookup, T: TryFrom<Cow<'a, [u8]>>>(
&'a self,
section_name: &'lookup str,
subsection_name: Option<&'lookup str>,
key: &'lookup str
) -> Result<Option<T>, Error<T::Error>>
sourcepub fn try_value_with_source<'lookup, T: TryFrom<Cow<'a, [u8]>>>(
&'a self,
section_name: &'lookup str,
subsection_name: Option<&'lookup str>,
key: &'lookup str
) -> Result<Option<(T, ConfigSource)>, Error<T::Error>>
pub fn try_value_with_source<'lookup, T: TryFrom<Cow<'a, [u8]>>>(
&'a self,
section_name: &'lookup str,
subsection_name: Option<&'lookup str>,
key: &'lookup str
) -> Result<Option<(T, ConfigSource)>, Error<T::Error>>
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<'a> Config<'a>
impl<'a> Config<'a>
Lower-level interface for directly accessing a
sourcepub fn config(&self, source: ConfigSource) -> Option<&File<'a>>
pub fn config(&self, source: ConfigSource) -> Option<&File<'a>>
Retrieves the underlying File
object, if one was found during
initialization.
sourcepub fn config_mut(&mut self, source: ConfigSource) -> Option<&mut File<'a>>
pub fn config_mut(&mut self, source: ConfigSource) -> Option<&mut File<'a>>
Retrieves the underlying File
object as a mutable reference,
if one was found during initialization.
Auto Trait Implementations
impl<'a> RefUnwindSafe for Config<'a>
impl<'a> Send for Config<'a>
impl<'a> Sync for Config<'a>
impl<'a> Unpin for Config<'a>
impl<'a> UnwindSafe for Config<'a>
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