[−][src]Struct pagecache::ConfigBuilder
Top-level configuration for the system.
Examples
let _config = pagecache::ConfigBuilder::default() .path("/path/to/data".to_owned()) .cache_capacity(10_000_000_000) .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]
pub fn new() -> Self
[src]
Returns a default ConfigBuilder
pub fn path<P: AsRef<Path>>(self, path: P) -> Self
[src]
Set the path of the database (builder).
pub fn build(self) -> Config
[src]
Finalize the configuration.
Panics
This function will panic if it is not possible to open the files for performing database IO, or if the provided configuration fails some basic sanity checks.
pub fn io_buf_size(self, to: usize) -> Self
[src]
size of each io flush buffer. MUST be multiple of 512!
pub fn page_consolidation_threshold(self, to: usize) -> Self
[src]
page consolidation threshold
pub fn temporary(self, to: bool) -> Self
[src]
deletes the database after drop. if no path is set, uses /dev/shm on linux
pub fn read_only(self, to: bool) -> Self
[src]
whether to run in read-only mode
pub fn cache_capacity(self, to: u64) -> Self
[src]
maximum size for the system page cache
pub fn use_compression(self, to: bool) -> Self
[src]
whether to use zstd compression
pub fn compression_factor(self, to: i32) -> Self
[src]
the compression factor to use with zstd compression
pub fn flush_every_ms(self, to: Option<u64>) -> Self
[src]
number of ms between IO buffer flushes
pub fn snapshot_after_ops(self, to: u64) -> Self
[src]
number of operations between page table snapshots
pub fn segment_cleanup_threshold(self, to: f64) -> Self
[src]
the proportion of remaining valid pages in the segment before GC defragments it
pub fn segment_cleanup_skew(self, to: usize) -> Self
[src]
the cleanup threshold skew in percentage points between the first and last segments
pub fn segment_mode(self, to: SegmentMode) -> Self
[src]
the file segment selection mode
pub fn snapshot_path(self, to: Option<PathBuf>) -> Self
[src]
snapshot file location
pub fn print_profile_on_drop(self, to: bool) -> Self
[src]
print a performance profile when the Config is dropped
pub fn idgen_persist_interval(self, to: u64) -> Self
[src]
generated IDs are persisted at this interval. during recovery we skip twice this number
Trait Implementations
impl Clone for ConfigBuilder
[src]
fn clone(&self) -> ConfigBuilder
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for ConfigBuilder
[src]
impl Send for ConfigBuilder
[src]
impl PartialEq<ConfigBuilder> for ConfigBuilder
[src]
fn eq(&self, other: &ConfigBuilder) -> bool
[src]
fn ne(&self, other: &ConfigBuilder) -> bool
[src]
impl Debug for ConfigBuilder
[src]
impl Serialize for ConfigBuilder
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for ConfigBuilder
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Sync for ConfigBuilder
impl Unpin for ConfigBuilder
impl UnwindSafe for ConfigBuilder
impl RefUnwindSafe for ConfigBuilder
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,