pub struct DefaultSetting<T, P>{ /* private fields */ }
Implementations§
Source§impl<T, P> DefaultSetting<T, P>
impl<T, P> DefaultSetting<T, P>
pub fn new( default_value: Option<T>, config_file_path: P, config_logger: Rc<Mutex<InspectConfigLogger>>, ) -> Self
Sourcepub fn get_cached_value(&mut self) -> Result<Option<T>, Error>
pub fn get_cached_value(&mut self) -> Result<Option<T>, Error>
Returns the value of this setting. Loads the value from storage if it hasn’t been loaded before, otherwise returns a cached value.
Sourcepub fn load_default_value(&mut self) -> Result<Option<T>, Error>
pub fn load_default_value(&mut self) -> Result<Option<T>, Error>
Loads the value of this setting from storage.
If the value isn’t present, returns the default value.
Auto Trait Implementations§
impl<T, P> Freeze for DefaultSetting<T, P>
impl<T, P> RefUnwindSafe for DefaultSetting<T, P>where
P: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, P> !Send for DefaultSetting<T, P>
impl<T, P> !Sync for DefaultSetting<T, P>
impl<T, P> Unpin for DefaultSetting<T, P>
impl<T, P> UnwindSafe for DefaultSetting<T, P>where
P: UnwindSafe,
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more