Struct sanakirja::Env

source ·
pub struct Env { /* private fields */ }
Expand description

Environment, required to start any transactions. Thread-safe, but opening the same database several times in the same process is not cross-platform.

Implementations

File size of the database path, if it exists.

Length of the environment.

Set the maximum number of dirty pages before triggering a flush.

Get the maximum number of dirty pages before triggering a flush.

Initialize an environment. length must be a strictly positive multiple of 4096. The same file can only be open in one process or thread at the same time, and this is enforced by a locked file.

Same as new, but does not take a lock on the file system.

This method is provided because waiting for a lock on the file system may block the whole process, whereas.

However, the database is very likely to get corrupted if open more than once at the same time, even within the same process.

Therefore, do not use this method without another locking mechanism in place to avoid that situation.

Start a read-only transaction.

Start a mutable transaction. Mutable transactions that go out of scope are automatically aborted.

Close this repository. It is undefined behaviour to use it afterwards.

Trait Implementations

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.