pub struct Config {
pub path: PathBuf,
pub temporary: bool,
pub use_compression: bool,
pub flush_every_ms: Option<u64>,
pub cache_capacity: Option<u64>,
pub segment_size: Option<usize>,
}
Expand description
Config is used to create a new store
Fields
path: PathBuf
The path
field determines where the database will be created
temporary: bool
The temporary
field specifies if the database will be destroyed on close
use_compression: bool
Enable compression by setting use_compression
to true
flush_every_ms: Option<u64>
Specify the flush frequency
cache_capacity: Option<u64>
Specify the cache capacity in bytes
segment_size: Option<usize>
Specify the segment size for compatibility
Implementations
sourceimpl Config
impl Config
sourcepub fn use_compression(self, use_compression: bool) -> Config
pub fn use_compression(self, use_compression: bool) -> Config
Set compression field
sourcepub fn flush_every_ms(self, ms: u64) -> Config
pub fn flush_every_ms(self, ms: u64) -> Config
Set flush frequency
sourcepub fn cache_capacity(self, bytes: u64) -> Config
pub fn cache_capacity(self, bytes: u64) -> Config
Set cache capacity
sourcepub fn segment_size(self, kb: usize) -> Config
pub fn segment_size(self, kb: usize) -> Config
Set cache capacity
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl PartialEq<Config> for Config
impl PartialEq<Config> for Config
impl StructuralPartialEq for Config
Auto Trait Implementations
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more