pub struct ConfigCache { /* private fields */ }Expand description
Helper for caching and managing effective configuration and policies
Implementations§
Source§impl ConfigCache
impl ConfigCache
Sourcepub fn new(persistence: Persistence) -> ConfigCache
pub fn new(persistence: Persistence) -> ConfigCache
Create a new ConfigCache with the given persistence
Sourcepub fn store_effective_config(&self, config: &AppConfig) -> Result<(), Error>
pub fn store_effective_config(&self, config: &AppConfig) -> Result<(), Error>
Store the effective configuration in the cache
Sourcepub fn load_effective_config(&self) -> Result<Option<AppConfig>, Error>
pub fn load_effective_config(&self) -> Result<Option<AppConfig>, Error>
Load the effective configuration from the cache
Sourcepub fn store_effective_policies(&self, policies: &Value) -> Result<(), Error>
pub fn store_effective_policies(&self, policies: &Value) -> Result<(), Error>
Store effective policies in the cache
Sourcepub fn load_effective_policies(&self) -> Result<Option<Value>, Error>
pub fn load_effective_policies(&self) -> Result<Option<Value>, Error>
Load effective policies from the cache
Sourcepub fn has_config_changed(&self, current: &AppConfig) -> Result<bool, Error>
pub fn has_config_changed(&self, current: &AppConfig) -> Result<bool, Error>
Compare the current config with the cached version Returns true if they differ, false if they’re the same
Auto Trait Implementations§
impl Freeze for ConfigCache
impl RefUnwindSafe for ConfigCache
impl Send for ConfigCache
impl Sync for ConfigCache
impl Unpin for ConfigCache
impl UnwindSafe for ConfigCache
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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