pub struct PersistentDataStoreBuilder { /* private fields */ }
Expand description
Used to create a PersistentDataStoreWrapper instance, which wraps a PersistentDataStore.
Implementations§
source§impl PersistentDataStoreBuilder
impl PersistentDataStoreBuilder
sourcepub fn new(factory: Arc<dyn PersistentDataStoreFactory>) -> Self
pub fn new(factory: Arc<dyn PersistentDataStoreFactory>) -> Self
Create a new PersistentDataStoreBuilder configured with the provided PersistentDataStoreFactory and a default cache lifetime.
sourcepub fn cache_time(&mut self, cache_ttl: Duration) -> &mut Self
pub fn cache_time(&mut self, cache_ttl: Duration) -> &mut Self
Specifies the cache TTL. Items will be evicted from the cache after this amount of time from the time when they were originally cached.
If the value is zero, caching is disabled (equivalent to PersistentDataStoreBuilder::no_caching).
sourcepub fn cache_seconds(&mut self, seconds: u64) -> &mut Self
pub fn cache_seconds(&mut self, seconds: u64) -> &mut Self
Shortcut for calling PersistentDataStoreBuilder::cache_time with a duration in seconds.
sourcepub fn cache_forever(&mut self) -> &mut Self
pub fn cache_forever(&mut self) -> &mut Self
Specifies that the in-memory cache should never expire. In this mode, data will be written to both the underlying persistent store and the cache, but will only ever be read from the persistent store if the SDK is restarted.
Use this mode with caution: it means that in a scenario where multiple processes are sharing the database, and the current process loses connectivity to LaunchDarkly while other processes are still receiving updates and writing them to the database, the current process will have stale data.
sourcepub fn no_caching(&mut self) -> &mut Self
pub fn no_caching(&mut self) -> &mut Self
Specifies that the SDK should not use an in-memory cache for the persistent data store. This means that every feature flag evaluation will trigger a data store query.
Trait Implementations§
source§impl Clone for PersistentDataStoreBuilder
impl Clone for PersistentDataStoreBuilder
source§fn clone(&self) -> PersistentDataStoreBuilder
fn clone(&self) -> PersistentDataStoreBuilder
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for PersistentDataStoreBuilder
impl !RefUnwindSafe for PersistentDataStoreBuilder
impl !Send for PersistentDataStoreBuilder
impl !Sync for PersistentDataStoreBuilder
impl Unpin for PersistentDataStoreBuilder
impl !UnwindSafe for PersistentDataStoreBuilder
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)