/// Enables caching device responses with the specified cache ttl (time-to-live)
/// and initial cache capacity.
///
/// By default, caching is disabled.
///
/// # Examples
///
/// ```
/// use std::time::Duration;
///
/// let config = tplink::Config::for_host([192, 168, 1, 100])
///     .with_cache_enabled(Duration::from_secs(3), Some(2 * 1024))
///     .build();
/// assert_eq!(config.cache_enabled(), true);
/// assert_eq!(config.cache_ttl(), Some(Duration::from_secs(3)));
/// assert_eq!(config.cache_initial_capacity(), Some(2 * 1024));
/// ```
Enables caching device responses with the specified cache ttl (time-to-live)
and initial cache capacity.

By default, caching is disabled.
Enables caching device responses with the specified cache ttl ( time - to - live ) and initial cache capacity . By default caching is disabled .
pub fn with_cache_enabled(
        &mut self,
        ttl: Duration,
        initial_capacity: Option<usize>,
    ) -> &mut ConfigBuilder {
        self.cache_config = CacheConfig {
            enable_cache: true,
            ttl: Some(ttl),
            initial_capacity,
        };
        self
    }
pub fn with_cache_enabled ( & mut self , ttl : Duration , initial_capacity : Option < usize > , ) -> & mut ConfigBuilder { self . cache_config = CacheConfig { enable_cache : true , ttl : Some ( ttl ) , initial_capacity , } ; self }
Enables caching device responses with the specified cache ttl (time-to-live)
and initial cache capacity.
Enables caching device responses with the specified cache ttl ( time - to - live ) and initial cache capacity .
&mut self
ttl
Duration
initial_capacity
Option<usize>
examples
```
use std::time::Duration.


` ` ` use std :: time :: Duration .