pub struct Config { /* private fields */ }
Expand description
Configuration of a cache.
Implementations§
source§impl Config
impl Config
sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new config with default values.
The default values are documented at the relevant set_* methods.
sourcepub fn set_max_cache_entries(&mut self, value: u64)
pub fn set_max_cache_entries(&mut self, value: u64)
Set the maximum number of cache entries.
The value has to be at least one, at most 1,000,000,000 and the default is 1000.
The values are just best guesses at the moment. The upper limit is set to be somewhat safe without being too limiting. The default is meant to be reasonable for a small system.
sourcepub fn set_max_validity(&mut self, value: Duration)
pub fn set_max_validity(&mut self, value: Duration)
Set the maximum validity of cache entries.
The value has to be at least 60 seconds, at most 6,048,000 seconds (10 weeks) and the default is 604800 seconds (one week).
sourcepub fn set_transport_failure_duration(&mut self, value: Duration)
pub fn set_transport_failure_duration(&mut self, value: Duration)
Set the time to cache transport failures.
The value has to be at least one second, at most 300 seconds (five minutes) and the default is 30 seconds.
sourcepub fn set_misc_error_duration(&mut self, value: Duration)
pub fn set_misc_error_duration(&mut self, value: Duration)
Set the maximum time to cache results other than NOERROR or NXDOMAIN.
The value has to be at least one second, at most 300 seconds (five minutes) and the default is 30 seconds.
sourcepub fn set_max_nxdomain_validity(&mut self, value: Duration)
pub fn set_max_nxdomain_validity(&mut self, value: Duration)
Set the maximum time to cache NXDOMAIN results.
The value has to be at least 60 seconds (one minute), at most 86,400 seconds (one day) and the default is 3,600 seconds (one hour).
sourcepub fn set_max_nodata_validity(&mut self, value: Duration)
pub fn set_max_nodata_validity(&mut self, value: Duration)
Set the maximum time to cache NODATA results.
The value has to be at least 60 seconds (one minute), at most 86,400 seconds (one day) and the default is 3,600 seconds (one hour).
sourcepub fn set_max_delegation_validity(&mut self, value: Duration)
pub fn set_max_delegation_validity(&mut self, value: Duration)
Set the maximum time to cache delegations.
The value has to be at least 60 seconds (one minute), at most 1,000,000,000 seconds and the default is 1,000,000 seconds.
sourcepub fn set_cache_truncated(&mut self, value: bool)
pub fn set_cache_truncated(&mut self, value: bool)
Enable or disable caching of response messages with the TC (truncated) flag set.
The default value is false (disabled).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)