Struct matterdb::DBOptions[][src]

#[non_exhaustive]
pub struct DBOptions { pub max_open_files: Option<i32>, pub create_if_missing: bool, pub compression_type: CompressionType, pub max_total_wal_size: Option<u64>, }

Options for the database.

These parameters apply to the underlying database, currently RocksDB.

Fields (Non-exhaustive)

Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct {{ .. }} syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
max_open_files: Option<i32>

Number of open files that can be used by the database.

The underlying database opens multiple files during operation. If your system has a limit on the number of files which can be open simultaneously, you can adjust this option to match the limit. Note, that limiting the number of simultaneously open files might slow down the speed of database operation.

Defaults to None, meaning that the number of open files is unlimited.

create_if_missing: bool

An option to indicate whether the system should create a database or not, if it’s missing.

This option applies to the cases when a node was switched off and is on again. If the database cannot be found at the indicated path and this option is switched on, a new database will be created at that path and blocks will be included therein.

Defaults to true.

compression_type: CompressionType

An algorithm used for database compression.

Defaults to CompressionType::None, meaning there is no compression.

max_total_wal_size: Option<u64>

Max total size of the WAL journal in bytes.

Defaults to None, meaning that the size of WAL journal will be adjusted by the rocksdb.

Implementations

impl DBOptions[src]

pub fn new(
    max_open_files: Option<i32>,
    create_if_missing: bool,
    compression_type: CompressionType,
    max_total_wal_size: Option<u64>
) -> Self
[src]

Creates a new DBOptions object.

Trait Implementations

impl Clone for DBOptions[src]

fn clone(&self) -> DBOptions[src]

Returns a copy of the value. Read more

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for DBOptions[src]

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

Formats the value using the given formatter. Read more

impl Default for DBOptions[src]

fn default() -> Self[src]

Returns the “default value” for a type. Read more

impl<'de> Deserialize<'de> for DBOptions[src]

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
    __D: Deserializer<'de>, 
[src]

Deserialize this value from the given Serde deserializer. Read more

impl PartialEq<DBOptions> for DBOptions[src]

fn eq(&self, other: &DBOptions) -> bool[src]

This method tests for self and other values to be equal, and is used by ==. Read more

fn ne(&self, other: &DBOptions) -> bool[src]

This method tests for !=.

impl Serialize for DBOptions[src]

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
    __S: Serializer
[src]

Serialize this value into the given Serde serializer. Read more

impl Copy for DBOptions[src]

impl StructuralPartialEq for DBOptions[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> Pointable for T

pub const ALIGN: usize

The alignment of pointer.

type Init = T

The type for initializers.

pub unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more

pub unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more

pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more

pub unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

pub fn to_owned(&self) -> T[src]

Creates owned data from borrowed data, usually by cloning. Read more

pub fn clone_into(&self, target: &mut T)[src]

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]