22use std:: { borrow:: Cow , ffi:: OsStr } ;
33
44use gix_features:: threading:: OwnShared ;
5+ use gix_macros:: momo;
56
67use crate :: {
78 bstr:: { BStr , BString , ByteSlice } ,
@@ -25,6 +26,7 @@ impl<'repo> Snapshot<'repo> {
2526 }
2627
2728 /// Like [`boolean()`][Self::boolean()], but it will report an error if the value couldn't be interpreted as boolean.
29+ #[ momo]
2830 pub fn try_boolean ( & self , key : impl gix_config:: AsKey ) -> Option < Result < bool , gix_config:: value:: Error > > {
2931 self . repo . config . resolved . boolean ( key)
3032 }
@@ -40,20 +42,23 @@ impl<'repo> Snapshot<'repo> {
4042 }
4143
4244 /// Like [`integer()`][Self::integer()], but it will report an error if the value couldn't be interpreted as boolean.
45+ #[ momo]
4346 pub fn try_integer ( & self , key : impl gix_config:: AsKey ) -> Option < Result < i64 , gix_config:: value:: Error > > {
4447 self . repo . config . resolved . integer ( key)
4548 }
4649
4750 /// Return the string at `key`, or `None` if there is no such value.
4851 ///
4952 /// Note that this method takes the most recent value at `key` even if it is from a file with reduced trust.
53+ #[ momo]
5054 pub fn string ( & self , key : impl gix_config:: AsKey ) -> Option < Cow < ' repo , BStr > > {
5155 self . repo . config . resolved . string ( key)
5256 }
5357
5458 /// Return the trusted and fully interpolated path at `key`, or `None` if there is no such value
5559 /// or if no value was found in a trusted file.
5660 /// An error occurs if the path could not be interpolated to its final value.
61+ #[ momo]
5762 pub fn trusted_path (
5863 & self ,
5964 key : impl gix_config:: AsKey ,
@@ -63,6 +68,7 @@ impl<'repo> Snapshot<'repo> {
6368
6469 /// Return the trusted string at `key` for launching using [command::prepare()](gix_command::prepare()),
6570 /// or `None` if there is no such value or if no value was found in a trusted file.
71+ #[ momo]
6672 pub fn trusted_program ( & self , key : impl gix_config:: AsKey ) -> Option < Cow < ' repo , OsStr > > {
6773 let value = self
6874 . repo
@@ -112,6 +118,7 @@ impl<'repo> SnapshotMut<'repo> {
112118
113119 /// Set the value at `key` to `new_value`, possibly creating the section if it doesn't exist yet, or overriding the most recent existing
114120 /// value, which will be returned.
121+ #[ momo]
115122 pub fn set_value < ' b > (
116123 & mut self ,
117124 key : & ' static dyn crate :: config:: tree:: Key ,
@@ -135,6 +142,7 @@ impl<'repo> SnapshotMut<'repo> {
135142
136143 /// Set the value at `key` to `new_value` in the given `subsection`, possibly creating the section and sub-section if it doesn't exist yet,
137144 /// or overriding the most recent existing value, which will be returned.
145+ #[ momo]
138146 pub fn set_subsection_value < ' a , ' b > (
139147 & mut self ,
140148 key : & ' static dyn crate :: config:: tree:: Key ,
0 commit comments