pub struct Config {
pub path: PathBuf,
pub cache_capacity_bytes: usize,
pub entry_cache_percent: u8,
pub flush_every_ms: Option<usize>,
pub zstd_compression_level: i32,
pub tempdir_deleter: Option<Arc<TempDir>>,
}
Fields§
§path: PathBuf
The base directory for storing the database.
cache_capacity_bytes: usize
Cache size in bytes. Default is 512mb.
entry_cache_percent: u8
The percentage of the cache that is dedicated to the scan-resistant entry cache.
flush_every_ms: Option<usize>
Start a background thread that flushes data to disk every few milliseconds. Defaults to every 200ms.
zstd_compression_level: i32
The zstd compression level to use when writing data to disk. Defaults to 3.
tempdir_deleter: Option<Arc<TempDir>>
This is only set to Some
for objects created via
Config::tmp
, and will remove the storage directory
when the final Arc drops.
Implementations§
source§impl Config
impl Config
sourcepub fn tmp() -> Result<Config>
pub fn tmp() -> Result<Config>
Returns a config with the path
initialized to a system
temporary directory that will be deleted when this Config
is dropped.
sourcepub fn flush_every_ms(self, to: Option<usize>) -> Self
pub fn flush_every_ms(self, to: Option<usize>) -> Self
Start a background thread that flushes data to disk every few milliseconds. Defaults to every 200ms.
sourcepub fn cache_capacity_bytes(self, to: usize) -> Self
pub fn cache_capacity_bytes(self, to: usize) -> Self
Cache size in bytes. Default is 512mb.
sourcepub fn entry_cache_percent(self, to: u8) -> Self
pub fn entry_cache_percent(self, to: u8) -> Self
The percentage of the cache that is dedicated to the scan-resistant entry cache.
sourcepub fn zstd_compression_level(self, to: i32) -> Self
pub fn zstd_compression_level(self, to: i32) -> Self
The zstd compression level to use when writing data to disk. Defaults to 3.