pub struct CacheConfig {
pub max_cache_size: usize,
pub cache_item_ttl: u128,
pub version_stage: String,
}Expand description
Configuration options for the SecretCache.
Defaults:
- max_cache_size: 1024
- cache_item_ttl: 3600000000000 (1hr)
- version_stage: “AWSCURRENT”
Fields§
§max_cache_size: usizeThe maximum number of secrets to maintain in the cache.
The least frequently accessed items will be evicted from the cache once a max_cache_size number of items are stored.
Default: 1024
cache_item_ttl: u128The TTL expiry of items in the cache.
Determines the number of nanoseconds a cached secret will be considered valid before the secret value is required to be refreshed. Refreshing happens synchronously.
Default: 3600000000000 (1 hour in nanoseconds)
version_stage: StringThe version stage used when requesting secrets from AWS Secrets Manager.
Default: “AWSCURRENT”
Implementations§
Source§impl CacheConfig
impl CacheConfig
Sourcepub fn new() -> Self
pub fn new() -> Self
Returns a new Cache Configuration with default values set.
Defaults:
- max_cache_size: 1024
- cache_item_ttl: 3600000000000 (1hr)
- version_stage: “AWSCURRENT”
Sourcepub fn max_cache_size(self, max_cache_size: usize) -> Self
pub fn max_cache_size(self, max_cache_size: usize) -> Self
Sets the max_cache_size cache configuration option to a different value.
Sourcepub fn cache_item_ttl(self, cache_item_ttl: u128) -> Self
pub fn cache_item_ttl(self, cache_item_ttl: u128) -> Self
Sets the cache_item_ttl cache configuration option to a different value.
Trait Implementations§
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§
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> 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>
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>
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