Struct sanakirja::Env
[−]
[src]
pub struct Env { /* fields omitted */ }
Environment, required to start any transactions. Thread-safe, but opening the same database several times in the same process is not cross-platform.
Methods
impl Env
[src]
fn file_size<P: AsRef<Path>>(path: P) -> Result<u64, Error>
File size of the database path, if it exists.
fn size(&self) -> u64
Length of the environment.
fn new<P: AsRef<Path>>(path: P, length: u64) -> Result<Env, Error>
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.
fn txn_begin<'env>(&'env self) -> Result<Txn<'env>, Error>
Start a read-only transaction.
fn mut_txn_begin<'env>(&'env self) -> Result<MutTxn<'env, ()>, Error>
Start a mutable transaction. Mutable transactions that go out of scope are automatically aborted.