[−][src]Struct sled::Config
Top-level configuration for the system.
Examples
let _config = sled::Config::default() .path("/path/to/data".to_owned()) .cache_capacity(10_000_000_000) .flush_every_ms(Some(1000));
Implementations
impl Config
[src]
pub fn new() -> Config
[src]
Returns a default Config
pub fn path<P: AsRef<Path>>(self, path: P) -> Config
[src]
Set the path of the database (builder).
pub fn open(&self) -> Result<Db>
[src]
Opens a Db
based on the provided config.
pub fn cache_capacity(self, to: u64) -> Self
[src]
maximum size in bytes for the system page cache
pub fn mode(self, to: Mode) -> Self
[src]
specify whether the system should run in "small" or "fast" mode
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. Ranges from 1 up to 22. 0 is 'default'. Levels >= 20 are 'ultra'.
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 create_new(self, to: bool) -> Self
[src]
attempts to exclusively open the database, failing if it already exists
pub fn print_profile_on_drop(self, to: bool) -> Self
[src]
print a performance profile when the Config is dropped
Trait Implementations
impl Clone for Config
[src]
impl Debug for Config
[src]
impl Default for Config
[src]
impl Deref for Config
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
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> 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>,