pub struct PersistentDataStoreBuilder { /* private fields */ }
Expand description
Used to create a PersistentDataStoreWrapper instance, which wraps a PersistentDataStore.
Implementations
sourceimpl 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
sourceimpl Clone for PersistentDataStoreBuilder
impl Clone for PersistentDataStoreBuilder
sourcefn clone(&self) -> PersistentDataStoreBuilder
fn clone(&self) -> PersistentDataStoreBuilder
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl !RefUnwindSafe for PersistentDataStoreBuilder
impl !Send for PersistentDataStoreBuilder
impl !Sync for PersistentDataStoreBuilder
impl Unpin for PersistentDataStoreBuilder
impl !UnwindSafe for PersistentDataStoreBuilder
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more