Struct DBOptions

Source
pub struct DBOptions { /* private fields */ }
Expand description

This structure represents options that can be used when constructing a LevelDB instance.

Implementations§

Source§

impl DBOptions

Source

pub fn new() -> Option<DBOptions>

Create and return a new DBOptions instance. Returns None if the underlying library call returns a null pointer.

Source

pub 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.

Source

pub 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

Source

pub fn set_error_if_exists(&mut self, val: bool) -> &mut DBOptions

Return an error if the database already exists.

Default: false

Source

pub 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

Source

pub 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

Source

pub 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

Source

pub 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

Source

pub 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

Trait Implementations§

Source§

impl Drop for DBOptions

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.