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
Source§impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous1, D> for Twhere
D: ResourceDialect,
Source§impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
impl<T, D> Encode<Ambiguous2, D> for Twhere
D: ResourceDialect,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more