pub struct CacheConfigBuilder { /* private fields */ }Expand description
What: Builder for creating CacheConfig with custom settings.
Inputs: None (created via CacheConfig::builder())
Output:
CacheConfigBuilderthat can be configured and built
Details:
- Allows customization of all cache settings
- All methods return
&mut Selffor method chaining - Call
build()to create theCacheConfig
Implementations§
Source§impl CacheConfigBuilder
impl CacheConfigBuilder
Sourcepub fn new() -> Self
pub fn new() -> Self
What: Create a new builder with default values.
Inputs: None
Output:
CacheConfigBuilderwith default configuration
Details:
- Starts with all caches disabled
- Uses default TTL values
Sourcepub fn enable_search(self, enable: bool) -> Self
pub fn enable_search(self, enable: bool) -> Self
What: Enable or disable search operation caching.
Inputs:
enable: Whether to enable search caching
Output:
&mut Selffor method chaining
Details:
- Default: false
Sourcepub fn search_ttl(self, ttl: Duration) -> Self
pub fn search_ttl(self, ttl: Duration) -> Self
What: Set TTL for search cache entries.
Inputs:
ttl: Time-to-live duration
Output:
&mut Selffor method chaining
Details:
- Default: 5 minutes
Sourcepub fn enable_info(self, enable: bool) -> Self
pub fn enable_info(self, enable: bool) -> Self
What: Enable or disable info operation caching.
Inputs:
enable: Whether to enable info caching
Output:
&mut Selffor method chaining
Details:
- Default: false
Sourcepub fn info_ttl(self, ttl: Duration) -> Self
pub fn info_ttl(self, ttl: Duration) -> Self
What: Set TTL for info cache entries.
Inputs:
ttl: Time-to-live duration
Output:
&mut Selffor method chaining
Details:
- Default: 15 minutes
Sourcepub fn enable_comments(self, enable: bool) -> Self
pub fn enable_comments(self, enable: bool) -> Self
What: Enable or disable comments operation caching.
Inputs:
enable: Whether to enable comments caching
Output:
&mut Selffor method chaining
Details:
- Default: false
Sourcepub fn comments_ttl(self, ttl: Duration) -> Self
pub fn comments_ttl(self, ttl: Duration) -> Self
What: Set TTL for comments cache entries.
Inputs:
ttl: Time-to-live duration
Output:
&mut Selffor method chaining
Details:
- Default: 10 minutes
Sourcepub fn enable_pkgbuild(self, enable: bool) -> Self
pub fn enable_pkgbuild(self, enable: bool) -> Self
What: Enable or disable pkgbuild operation caching.
Inputs:
enable: Whether to enable pkgbuild caching
Output:
&mut Selffor method chaining
Details:
- Default: false
Sourcepub fn pkgbuild_ttl(self, ttl: Duration) -> Self
pub fn pkgbuild_ttl(self, ttl: Duration) -> Self
What: Set TTL for pkgbuild cache entries.
Inputs:
ttl: Time-to-live duration
Output:
&mut Selffor method chaining
Details:
- Default: 1 hour
Sourcepub fn memory_cache_size(self, size: usize) -> Self
pub fn memory_cache_size(self, size: usize) -> Self
What: Set maximum number of entries in memory cache per operation.
Inputs:
size: Maximum cache size
Output:
&mut Selffor method chaining
Details:
- Default: 100
Sourcepub fn enable_disk_cache(self, enable: bool) -> Self
pub fn enable_disk_cache(self, enable: bool) -> Self
What: Enable or disable disk cache.
Inputs:
enable: Whether to enable disk cache
Output:
&mut Selffor method chaining
Details:
- Default: false
Sourcepub fn build(self) -> CacheConfig
pub fn build(self) -> CacheConfig
What: Build the CacheConfig with configured settings.
Inputs: None
Output:
CacheConfigwith configured values
Details:
- Consumes the builder
- Returns the configured
CacheConfig
Trait Implementations§
Source§impl Clone for CacheConfigBuilder
impl Clone for CacheConfigBuilder
Source§fn clone(&self) -> CacheConfigBuilder
fn clone(&self) -> CacheConfigBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more