Struct leveldb_rs::DBOptions
[−]
[src]
pub struct DBOptions { /* fields omitted */ }
This structure represents options that can be used when constructing a LevelDB instance.
Methods
impl DBOptions
[src]
fn new() -> Option<DBOptions>
Create and return a new DBOptions instance. Returns None
if the
underlying library call returns a null pointer.
fn set_comparator(&mut self, cmp: DBComparator) -> &mut DBOptions
Set the comparator to use for this database. By default, LevelDB uses a comparator does a lexicographic comparison. Note also that a comparator must be thread-safe.
fn set_create_if_missing(&mut self, val: bool) -> &mut DBOptions
Create the database if it's missing when we try to open it.
Default: false
fn set_error_if_exists(&mut self, val: bool) -> &mut DBOptions
Return an error if the database already exists.
Default: false
fn set_paranoid_checks(&mut self, val: bool) -> &mut DBOptions
If set to true, the library will do aggressive checking of all data that it is processing and will stop early if it detects any errors.
Default: false
fn set_write_buffer_size(&mut self, val: usize) -> &mut DBOptions
Amount of data to build up in memory (backed by an unsorted log on-disk) before converting to a sorted on-disk file.
Default: 4MiB
fn set_max_open_files(&mut self, val: isize) -> &mut DBOptions
Number of open files that can be used by the DB. This value should be approximately one open file per 2MB of working set.
Default: 1000
fn set_block_size(&mut self, val: usize) -> &mut DBOptions
Approximate size of user data packed per block. Note that this corresponds to uncompressed data.
Default: 4KB
fn set_block_restart_interval(&mut self, val: isize) -> &mut DBOptions
Number of keys between restart points for delta encoding of keys. Most clients should not change this parameter.
Default: 16