Struct sled_web::sled::ConfigBuilder [−]
pub struct ConfigBuilder { /* fields omitted */ }Top-level configuration for the system.
Examples
let _config = pagecache::ConfigBuilder::default() .path("/path/to/data".to_owned()) .cache_capacity(10_000_000_000) .use_compression(true) .flush_every_ms(Some(1000)) .snapshot_after_ops(100_000);
// Read-only mode let _config = pagecache::ConfigBuilder::default() .path("/path/to/data".to_owned()) .read_only(true);
Methods
impl ConfigBuilder
impl ConfigBuilderpub fn new() -> ConfigBuilder
pub fn new() -> ConfigBuilderReturns a default ConfigBuilder
pub fn path<P>(self, path: P) -> ConfigBuilder where
P: AsRef<Path>,
pub fn path<P>(self, path: P) -> ConfigBuilder where
P: AsRef<Path>, Set the path of the database (builder).
pub fn set_path<P>(&mut self, path: P) where
P: AsRef<Path>,
pub fn set_path<P>(&mut self, path: P) where
P: AsRef<Path>, Set the path of the database
pub fn merge_operator(
self,
mo: fn(&[u8], Option<&[u8]>, &[u8]) -> Option<Vec<u8>>
) -> ConfigBuilder
pub fn merge_operator(
self,
mo: fn(&[u8], Option<&[u8]>, &[u8]) -> Option<Vec<u8>>
) -> ConfigBuilderSet the merge operator that can be relied on during merges in
the PageCache.
pub fn build(self) -> Config
pub fn build(self) -> ConfigFinalize the configuration.
pub fn set_io_bufs(&mut self, to: usize)
pub fn set_io_bufs(&mut self, to: usize)number of io buffers
pub fn io_bufs(self, to: usize) -> ConfigBuilder
pub fn io_bufs(self, to: usize) -> ConfigBuildernumber of io buffers
pub fn set_io_buf_size(&mut self, to: usize)
pub fn set_io_buf_size(&mut self, to: usize)size of each io flush buffer. MUST be multiple of 512!
pub fn io_buf_size(self, to: usize) -> ConfigBuilder
pub fn io_buf_size(self, to: usize) -> ConfigBuildersize of each io flush buffer. MUST be multiple of 512!
pub fn set_min_items_per_segment(&mut self, to: usize)
pub fn set_min_items_per_segment(&mut self, to: usize)minimum data chunks/pages in a segment.
pub fn min_items_per_segment(self, to: usize) -> ConfigBuilder
pub fn min_items_per_segment(self, to: usize) -> ConfigBuilderminimum data chunks/pages in a segment.
pub fn set_blink_fanout(&mut self, to: u8)
pub fn set_blink_fanout(&mut self, to: u8)b-link node fanout, minimum of 2
pub fn blink_fanout(self, to: u8) -> ConfigBuilder
pub fn blink_fanout(self, to: u8) -> ConfigBuilderb-link node fanout, minimum of 2
pub fn set_page_consolidation_threshold(&mut self, to: usize)
pub fn set_page_consolidation_threshold(&mut self, to: usize)page consolidation threshold
pub fn page_consolidation_threshold(self, to: usize) -> ConfigBuilder
pub fn page_consolidation_threshold(self, to: usize) -> ConfigBuilderpage consolidation threshold
pub fn set_temporary(&mut self, to: bool)
pub fn set_temporary(&mut self, to: bool)if this database should be removed after the ConfigBuilder is dropped
pub fn temporary(self, to: bool) -> ConfigBuilder
pub fn temporary(self, to: bool) -> ConfigBuilderif this database should be removed after the ConfigBuilder is dropped
pub fn set_read_only(&mut self, to: bool)
pub fn set_read_only(&mut self, to: bool)whether to run in read-only mode
pub fn read_only(self, to: bool) -> ConfigBuilder
pub fn read_only(self, to: bool) -> ConfigBuilderwhether to run in read-only mode
pub fn set_cache_bits(&mut self, to: usize)
pub fn set_cache_bits(&mut self, to: usize)log base 2 of the number of cache shards
pub fn cache_bits(self, to: usize) -> ConfigBuilder
pub fn cache_bits(self, to: usize) -> ConfigBuilderlog base 2 of the number of cache shards
pub fn set_cache_capacity(&mut self, to: usize)
pub fn set_cache_capacity(&mut self, to: usize)maximum size for the system page cache
pub fn cache_capacity(self, to: usize) -> ConfigBuilder
pub fn cache_capacity(self, to: usize) -> ConfigBuildermaximum size for the system page cache
pub fn set_use_os_cache(&mut self, to: bool)
pub fn set_use_os_cache(&mut self, to: bool)whether to use the OS page cache
pub fn use_os_cache(self, to: bool) -> ConfigBuilder
pub fn use_os_cache(self, to: bool) -> ConfigBuilderwhether to use the OS page cache
pub fn set_use_compression(&mut self, to: bool)
pub fn set_use_compression(&mut self, to: bool)whether to use zstd compression
pub fn use_compression(self, to: bool) -> ConfigBuilder
pub fn use_compression(self, to: bool) -> ConfigBuilderwhether to use zstd compression
pub fn set_zstd_compression_factor(&mut self, to: i32)
pub fn set_zstd_compression_factor(&mut self, to: i32)the compression factor to use with zstd compression
pub fn zstd_compression_factor(self, to: i32) -> ConfigBuilder
pub fn zstd_compression_factor(self, to: i32) -> ConfigBuilderthe compression factor to use with zstd compression
pub fn set_flush_every_ms(&mut self, to: Option<u64>)
pub fn set_flush_every_ms(&mut self, to: Option<u64>)number of ms between IO buffer flushes
pub fn flush_every_ms(self, to: Option<u64>) -> ConfigBuilder
pub fn flush_every_ms(self, to: Option<u64>) -> ConfigBuildernumber of ms between IO buffer flushes
pub fn set_snapshot_after_ops(&mut self, to: usize)
pub fn set_snapshot_after_ops(&mut self, to: usize)number of operations between page table snapshots
pub fn snapshot_after_ops(self, to: usize) -> ConfigBuilder
pub fn snapshot_after_ops(self, to: usize) -> ConfigBuildernumber of operations between page table snapshots
pub fn set_cache_fixup_threshold(&mut self, to: usize)
pub fn set_cache_fixup_threshold(&mut self, to: usize)the maximum length of a cached page fragment chain
pub fn cache_fixup_threshold(self, to: usize) -> ConfigBuilder
pub fn cache_fixup_threshold(self, to: usize) -> ConfigBuilderthe maximum length of a cached page fragment chain
pub fn set_segment_cleanup_threshold(&mut self, to: f64)
pub fn set_segment_cleanup_threshold(&mut self, to: f64)the proportion of remaining valid pages in the segment
pub fn segment_cleanup_threshold(self, to: f64) -> ConfigBuilder
pub fn segment_cleanup_threshold(self, to: f64) -> ConfigBuilderthe proportion of remaining valid pages in the segment
pub fn set_min_free_segments(&mut self, to: usize)
pub fn set_min_free_segments(&mut self, to: usize)the minimum number of free segments to have on-deck before a compaction occurs
pub fn min_free_segments(self, to: usize) -> ConfigBuilder
pub fn min_free_segments(self, to: usize) -> ConfigBuilderthe minimum number of free segments to have on-deck before a compaction occurs
pub fn set_zero_copy_storage(&mut self, to: bool)
pub fn set_zero_copy_storage(&mut self, to: bool)disabling of the log segment copy cleaner
pub fn zero_copy_storage(self, to: bool) -> ConfigBuilder
pub fn zero_copy_storage(self, to: bool) -> ConfigBuilderdisabling of the log segment copy cleaner
pub fn set_segment_mode(&mut self, to: SegmentMode)
pub fn set_segment_mode(&mut self, to: SegmentMode)the file segment selection mode
pub fn segment_mode(self, to: SegmentMode) -> ConfigBuilder
pub fn segment_mode(self, to: SegmentMode) -> ConfigBuilderthe file segment selection mode
pub fn set_snapshot_path(&mut self, to: Option<PathBuf>)
pub fn set_snapshot_path(&mut self, to: Option<PathBuf>)snapshot file location
pub fn snapshot_path(self, to: Option<PathBuf>) -> ConfigBuilder
pub fn snapshot_path(self, to: Option<PathBuf>) -> ConfigBuildersnapshot file location
Trait Implementations
impl Send for ConfigBuilder
impl Send for ConfigBuilderimpl Clone for ConfigBuilder
impl Clone for ConfigBuilderfn clone(&self) -> ConfigBuilder
fn clone(&self) -> ConfigBuilderReturns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)1.0.0[src]
fn clone_from(&mut self, source: &Self)Performs copy-assignment from source. Read more
impl Serialize for ConfigBuilder
impl Serialize for ConfigBuilderfn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer, Serialize this value into the given Serde serializer. Read more
impl Default for ConfigBuilder
impl Default for ConfigBuilderfn default() -> ConfigBuilder
fn default() -> ConfigBuilderReturns the "default value" for a type. Read more
impl<'de> Deserialize<'de> for ConfigBuilder
impl<'de> Deserialize<'de> for ConfigBuilderfn deserialize<__D>(
__deserializer: __D
) -> Result<ConfigBuilder, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<ConfigBuilder, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>, Deserialize this value from the given Serde deserializer. Read more
impl Debug for ConfigBuilder
impl Debug for ConfigBuilderfn fmt(&self, f: &mut Formatter) -> Result<(), Error>
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>Formats the value using the given formatter. Read more
impl PartialEq<ConfigBuilder> for ConfigBuilder
impl PartialEq<ConfigBuilder> for ConfigBuilderfn eq(&self, other: &ConfigBuilder) -> bool
fn eq(&self, other: &ConfigBuilder) -> boolThis method tests for self and other values to be equal, and is used by ==. Read more
fn ne(&self, other: &ConfigBuilder) -> bool
fn ne(&self, other: &ConfigBuilder) -> boolThis method tests for !=.
Auto Trait Implementations
impl Sync for ConfigBuilder
impl Sync for ConfigBuilder