Struct Options

Source
pub struct Options {
    pub create_if_missing: bool,
    pub error_if_exists: bool,
    pub paranoid_checks: bool,
    pub write_buffer_size: Option<size_t>,
    pub max_open_files: Option<i32>,
    pub block_size: Option<size_t>,
    pub block_restart_interval: Option<i32>,
    pub compression: Compression,
    pub cache: Option<Cache>,
}
Expand description

Options to consider when opening a new or pre-existing database.

Note that in contrast to the leveldb C API, the Comparator is not passed using this structure.

For more detailed explanations, consider the leveldb documentation

Fields§

§create_if_missing: bool

create the database if missing

default: false

§error_if_exists: bool

report an error if the DB already exists instead of opening.

default: false

§paranoid_checks: bool

paranoid checks make the database report an error as soon as corruption is detected.

default: false

§write_buffer_size: Option<size_t>

Override the size of the write buffer to use.

default: None

§max_open_files: Option<i32>

Override the max number of open files.

default: None

§block_size: Option<size_t>

Override the size of the blocks leveldb uses for writing and caching.

default: None

§block_restart_interval: Option<i32>

Override the interval between restart points.

default: None

§compression: Compression

Define whether leveldb should write compressed or not.

default: Compression::No

§cache: Option<Cache>

A cache to use during read operations.

default: None

Implementations§

Source§

impl Options

Source

pub fn new() -> Options

Create a new Options struct with default settings.

Trait Implementations§

Source§

impl Debug for Options

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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.