Struct sanakirja::Env [−][src]
pub struct Env { /* fields omitted */ }
Expand description
An environment, which may be either a memory-mapped file, or
memory allocated with std::alloc
.
Implementations
impl Env
[src]
impl Env
[src]pub unsafe fn new_nolock<P: AsRef<Path>>(
path: P,
length: u64,
n_roots: usize
) -> Result<Self, Error>
[src]
pub unsafe fn new_nolock<P: AsRef<Path>>(
path: P,
length: u64,
n_roots: usize
) -> Result<Self, Error>
[src]Same as new
, but does not create any lock on the
file system.
The database is very likely to get corrupted if an environment is opened from multiple processes, or more than once by the same process, if at least one of these instances can start a mutable transaction.
The n_roots
argument is ignored if the database already
exists, and is used to initialise the first n_roots
pages of
the file else.
impl Env
[src]
impl Env
[src]pub fn new<P: AsRef<Path>>(
path: P,
length: u64,
n_roots: usize
) -> Result<Env, Error>
[src]
pub fn new<P: AsRef<Path>>(
path: P,
length: u64,
n_roots: usize
) -> Result<Env, Error>
[src]Initialize an environment. If length
is not a multiple of
4096
, it is rounded to the next multiple of the page size
(4096 bytes).
The n_roots
parameter is the maximum number of versions that
can be alive at the same time, before mut_txn_begin
must
wait for old readers to stop.
If n_roots
is 1, mutable transactions exclude all readers.