Struct sled::ConfigBuilder [−][src]
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
[src]
impl ConfigBuilder
pub fn new() -> ConfigBuilder
[src]
pub fn new() -> ConfigBuilder
Returns a default ConfigBuilder
pub fn path<P>(self, path: P) -> ConfigBuilder where
P: AsRef<Path>,
[src]
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>,
[src]
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
[src]
pub fn merge_operator(
self,
mo: fn(&[u8], Option<&[u8]>, &[u8]) -> Option<Vec<u8>>
) -> ConfigBuilder
Set the merge operator that can be relied on during merges in
the PageCache
.
pub fn build(self) -> Config
[src]
pub fn build(self) -> Config
Finalize the configuration.
pub fn set_io_bufs(&mut self, to: usize)
[src]
pub fn set_io_bufs(&mut self, to: usize)
number of io buffers
pub fn io_bufs(self, to: usize) -> ConfigBuilder
[src]
pub fn io_bufs(self, to: usize) -> ConfigBuilder
number of io buffers
pub fn set_io_buf_size(&mut self, to: usize)
[src]
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
[src]
pub fn io_buf_size(self, to: usize) -> ConfigBuilder
size of each io flush buffer. MUST be multiple of 512!
pub fn set_min_items_per_segment(&mut self, to: usize)
[src]
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
[src]
pub fn min_items_per_segment(self, to: usize) -> ConfigBuilder
minimum data chunks/pages in a segment.
pub fn set_blink_fanout(&mut self, to: u8)
[src]
pub fn set_blink_fanout(&mut self, to: u8)
b-link node fanout, minimum of 2
pub fn blink_fanout(self, to: u8) -> ConfigBuilder
[src]
pub fn blink_fanout(self, to: u8) -> ConfigBuilder
b-link node fanout, minimum of 2
pub fn set_page_consolidation_threshold(&mut self, to: usize)
[src]
pub fn set_page_consolidation_threshold(&mut self, to: usize)
page consolidation threshold
pub fn page_consolidation_threshold(self, to: usize) -> ConfigBuilder
[src]
pub fn page_consolidation_threshold(self, to: usize) -> ConfigBuilder
page consolidation threshold
pub fn set_temporary(&mut self, to: bool)
[src]
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
[src]
pub fn temporary(self, to: bool) -> ConfigBuilder
if this database should be removed after the ConfigBuilder is dropped
pub fn set_read_only(&mut self, to: bool)
[src]
pub fn set_read_only(&mut self, to: bool)
whether to run in read-only mode
pub fn read_only(self, to: bool) -> ConfigBuilder
[src]
pub fn read_only(self, to: bool) -> ConfigBuilder
whether to run in read-only mode
pub fn set_cache_bits(&mut self, to: usize)
[src]
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
[src]
pub fn cache_bits(self, to: usize) -> ConfigBuilder
log base 2 of the number of cache shards
pub fn set_cache_capacity(&mut self, to: usize)
[src]
pub fn set_cache_capacity(&mut self, to: usize)
maximum size for the system page cache
pub fn cache_capacity(self, to: usize) -> ConfigBuilder
[src]
pub fn cache_capacity(self, to: usize) -> ConfigBuilder
maximum size for the system page cache
pub fn set_use_os_cache(&mut self, to: bool)
[src]
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
[src]
pub fn use_os_cache(self, to: bool) -> ConfigBuilder
whether to use the OS page cache
pub fn set_use_compression(&mut self, to: bool)
[src]
pub fn set_use_compression(&mut self, to: bool)
whether to use zstd compression
pub fn use_compression(self, to: bool) -> ConfigBuilder
[src]
pub fn use_compression(self, to: bool) -> ConfigBuilder
whether to use zstd compression
pub fn set_zstd_compression_factor(&mut self, to: i32)
[src]
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
[src]
pub fn zstd_compression_factor(self, to: i32) -> ConfigBuilder
the compression factor to use with zstd compression
pub fn set_flush_every_ms(&mut self, to: Option<u64>)
[src]
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
[src]
pub fn flush_every_ms(self, to: Option<u64>) -> ConfigBuilder
number of ms between IO buffer flushes
pub fn set_snapshot_after_ops(&mut self, to: usize)
[src]
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
[src]
pub fn snapshot_after_ops(self, to: usize) -> ConfigBuilder
number of operations between page table snapshots
pub fn set_cache_fixup_threshold(&mut self, to: usize)
[src]
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
[src]
pub fn cache_fixup_threshold(self, to: usize) -> ConfigBuilder
the maximum length of a cached page fragment chain
pub fn set_segment_cleanup_threshold(&mut self, to: f64)
[src]
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
[src]
pub fn segment_cleanup_threshold(self, to: f64) -> ConfigBuilder
the proportion of remaining valid pages in the segment
pub fn set_min_free_segments(&mut self, to: usize)
[src]
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
[src]
pub fn min_free_segments(self, to: usize) -> ConfigBuilder
the minimum number of free segments to have on-deck before a compaction occurs
pub fn set_zero_copy_storage(&mut self, to: bool)
[src]
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
[src]
pub fn zero_copy_storage(self, to: bool) -> ConfigBuilder
disabling of the log segment copy cleaner
pub fn set_segment_mode(&mut self, to: SegmentMode)
[src]
pub fn set_segment_mode(&mut self, to: SegmentMode)
the file segment selection mode
pub fn segment_mode(self, to: SegmentMode) -> ConfigBuilder
[src]
pub fn segment_mode(self, to: SegmentMode) -> ConfigBuilder
the file segment selection mode
pub fn set_snapshot_path(&mut self, to: Option<PathBuf>)
[src]
pub fn set_snapshot_path(&mut self, to: Option<PathBuf>)
snapshot file location
pub fn snapshot_path(self, to: Option<PathBuf>) -> ConfigBuilder
[src]
pub fn snapshot_path(self, to: Option<PathBuf>) -> ConfigBuilder
snapshot file location
Trait Implementations
impl Serialize for ConfigBuilder
[src]
impl Serialize for ConfigBuilder
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error> where
__S: Serializer,
[src]
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 Send for ConfigBuilder
[src]
impl Send for ConfigBuilder
impl<'de> Deserialize<'de> for ConfigBuilder
[src]
impl<'de> Deserialize<'de> for ConfigBuilder
fn deserialize<__D>(
__deserializer: __D
) -> Result<ConfigBuilder, <__D as Deserializer<'de>>::Error> where
__D: Deserializer<'de>,
[src]
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 Clone for ConfigBuilder
[src]
impl Clone for ConfigBuilder
fn clone(&self) -> ConfigBuilder
[src]
fn clone(&self) -> ConfigBuilder
Returns 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 Default for ConfigBuilder
[src]
impl Default for ConfigBuilder
fn default() -> ConfigBuilder
[src]
fn default() -> ConfigBuilder
Returns the "default value" for a type. Read more
impl Debug for ConfigBuilder
[src]
impl Debug for ConfigBuilder
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
[src]
fn fmt(&self, f: &mut Formatter) -> Result<(), Error>
Formats the value using the given formatter. Read more
impl PartialEq<ConfigBuilder> for ConfigBuilder
[src]
impl PartialEq<ConfigBuilder> for ConfigBuilder
fn eq(&self, other: &ConfigBuilder) -> bool
[src]
fn eq(&self, other: &ConfigBuilder) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &ConfigBuilder) -> bool
[src]
fn ne(&self, other: &ConfigBuilder) -> bool
This method tests for !=
.
Auto Trait Implementations
impl Sync for ConfigBuilder
impl Sync for ConfigBuilder