pub struct StoreBuilder { /* private fields */ }
Expand description
Builder for creating FeoxStore with custom configuration.
Provides a fluent interface for configuring store parameters.
§Example
use feoxdb::FeoxStore;
let store = FeoxStore::builder()
.max_memory(1_000_000_000)
.hash_bits(20)
.build()?;
Implementations§
Source§impl StoreBuilder
impl StoreBuilder
pub fn new() -> Self
Sourcepub fn device_path(self, path: impl Into<String>) -> Self
pub fn device_path(self, path: impl Into<String>) -> Self
Set the device path for persistent storage.
When set, data will be persisted to disk asynchronously. If not set, the store operates in memory-only mode.
Sourcepub fn max_memory(self, limit: usize) -> Self
pub fn max_memory(self, limit: usize) -> Self
Set the maximum memory limit (in bytes).
The store will start evicting entries when this limit is approached. Default: 1GB
Sourcepub fn no_memory_limit(self) -> Self
pub fn no_memory_limit(self) -> Self
Remove memory limit.
Use with caution as the store can grow unbounded.
Sourcepub fn hash_bits(self, bits: u32) -> Self
pub fn hash_bits(self, bits: u32) -> Self
Set number of hash bits (determines hash table size).
More bits = larger hash table = better performance for large datasets. Default: 18 (256K buckets)
Sourcepub fn enable_caching(self, enable: bool) -> Self
pub fn enable_caching(self, enable: bool) -> Self
Enable or disable caching.
When enabled, frequently accessed values are kept in memory even after being written to disk. Uses CLOCK eviction algorithm.