pub struct CacheConfig {
pub cache_dir: Option<String>,
pub not_load_cache_at_start: bool,
pub update_cache_when_empty: bool,
pub failover_enabled: bool,
}Expand description
Cache configuration
Fields§
§cache_dir: Option<String>Cache directory for local failover cache
not_load_cache_at_start: boolDo not load cache at startup
update_cache_when_empty: boolUpdate in-memory cache when empty (failover mode)
failover_enabled: boolEnable file-based failover cache
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn with_cache_dir(self, dir: impl Into<String>) -> Self
pub fn with_cache_dir(self, dir: impl Into<String>) -> Self
Set cache directory
Sourcepub fn with_not_load_cache_at_start(self, enabled: bool) -> Self
pub fn with_not_load_cache_at_start(self, enabled: bool) -> Self
Set not load cache at start
Sourcepub fn with_update_cache_when_empty(self, enabled: bool) -> Self
pub fn with_update_cache_when_empty(self, enabled: bool) -> Self
Set update cache when empty
Sourcepub fn with_failover_enabled(self, enabled: bool) -> Self
pub fn with_failover_enabled(self, enabled: bool) -> Self
Set failover enabled
Trait Implementations§
Source§impl Clone for CacheConfig
impl Clone for CacheConfig
Source§fn clone(&self) -> CacheConfig
fn clone(&self) -> CacheConfig
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CacheConfig
impl Debug for CacheConfig
Auto Trait Implementations§
impl Freeze for CacheConfig
impl RefUnwindSafe for CacheConfig
impl Send for CacheConfig
impl Sync for CacheConfig
impl Unpin for CacheConfig
impl UnwindSafe for CacheConfig
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request