Skip to main content

EnvironmentMutableConfig

Struct EnvironmentMutableConfig 

Source
pub struct EnvironmentMutableConfig {
    pub cache_size: Option<usize>,
    pub durability: Option<Durability>,
    pub txn_no_sync: bool,
    pub txn_write_no_sync: bool,
    pub run_cleaner: Option<bool>,
    pub run_checkpointer: Option<bool>,
    pub run_evictor: Option<bool>,
    pub lock_timeout_ms: Option<u64>,
    pub txn_timeout_ms: Option<u64>,
}
Expand description

The subset of environment properties that can be changed after the environment has been opened.

Obtain via Environment::get_mutable_config and apply via Environment::set_mutable_config.

Implements EnvironmentMutableConfig.

§Example

let mut cfg = env.get_mutable_config()?;
cfg.cache_size = Some(256 * 1024 * 1024); // 256 MiB
env.set_mutable_config(cfg)?;

Fields§

§cache_size: Option<usize>

Override the B-tree cache size in bytes. None means unchanged.

Implements EnvironmentMutableConfig.setCacheSize().

§durability: Option<Durability>

Override the default transaction durability for this environment. None means unchanged.

Implements EnvironmentMutableConfig.setDurability().

§txn_no_sync: bool

If true, committed transactions do not flush to disk (no-sync).

Deprecated since 2.4.1 — use durability with Durability::commit_no_sync() instead.

§txn_write_no_sync: bool

If true, committed transactions flush to the OS buffer but do not call fdatasync (write-no-sync).

Deprecated since 2.4.1 — use durability with Durability::commit_write_no_sync() instead.

§run_cleaner: Option<bool>

Enable or disable the cleaner daemon. None means unchanged.

§run_checkpointer: Option<bool>

Enable or disable the checkpointer daemon. None means unchanged.

§run_evictor: Option<bool>

Enable or disable the evictor daemon. None means unchanged.

§lock_timeout_ms: Option<u64>

Lock timeout in milliseconds. None means unchanged.

To explicitly clear a previously-configured timeout, set Some(0) (which JE interprets as “no timeout”). v1.5.0 used a u64 with 0 as the unchanged sentinel which made it impossible to clear a timeout; see (Transaction-Env F19/F20).

§txn_timeout_ms: Option<u64>

Transaction timeout in milliseconds. None means unchanged.

Some(0) clears any previously-configured timeout.

Implementations§

Source§

impl EnvironmentMutableConfig

Source

pub fn new() -> Self

Creates a new EnvironmentMutableConfig with no changes pending.

Source

pub fn with_cache_size(self, bytes: usize) -> Self

Sets the cache size override.

Source

pub fn with_durability(self, durability: Durability) -> Self

Sets the durability override.

Source

pub fn with_txn_no_sync(self, no_sync: bool) -> Self

👎Deprecated since 2.4.1:

use with_durability(Durability::commit_no_sync()) instead

Sets the txn_no_sync flag.

Deprecated — use with_durability with Durability::commit_no_sync() instead.

Source

pub fn with_txn_write_no_sync(self, write_no_sync: bool) -> Self

👎Deprecated since 2.4.1:

use with_durability(Durability::commit_write_no_sync()) instead

Sets the txn_write_no_sync flag.

Deprecated — use with_durability with Durability::commit_write_no_sync() instead.

Source

pub fn with_run_cleaner(self, run: bool) -> Self

Enables/disables the cleaner daemon.

Source

pub fn with_run_checkpointer(self, run: bool) -> Self

Enables/disables the checkpointer daemon.

Source

pub fn with_run_evictor(self, run: bool) -> Self

Enables/disables the evictor daemon.

Source

pub fn with_lock_timeout_ms(self, ms: Option<u64>) -> Self

Sets the lock timeout (milliseconds).

Pass Some(0) to clear a previously-configured timeout, or None to leave it unchanged.

Source

pub fn with_txn_timeout_ms(self, ms: Option<u64>) -> Self

Sets the transaction timeout (milliseconds).

Pass Some(0) to clear a previously-configured timeout, or None to leave it unchanged.

Trait Implementations§

Source§

impl Clone for EnvironmentMutableConfig

Source§

fn clone(&self) -> EnvironmentMutableConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EnvironmentMutableConfig

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for EnvironmentMutableConfig

Source§

fn default() -> EnvironmentMutableConfig

Returns the “default value” for a 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more