pub struct Environment { /* private fields */ }
Expand description
Represents LMDB Environment. Should be opened using EnvBuilder
Implementations§
Source§impl Environment
impl Environment
pub fn new() -> EnvBuilder
Sourcepub fn reader_check(&self) -> MdbResult<c_int>
pub fn reader_check(&self) -> MdbResult<c_int>
Check for stale entries in the reader lock table.
Returns the number of stale slots that were cleared.
pub fn info(&self) -> MdbResult<MDB_envinfo>
Sourcepub fn set_mapsize(&self, map_size: usize) -> MdbResult<()>
pub fn set_mapsize(&self, map_size: usize) -> MdbResult<()>
Sets map size. This can be called after open if no transactions are active in this process.
Sourcepub fn set_flags(&mut self, flags: EnvFlags, turn_on: bool) -> MdbResult<()>
pub fn set_flags(&mut self, flags: EnvFlags, turn_on: bool) -> MdbResult<()>
This one sets only flags which are available for change even after opening, see also get_flags and get_all_flags
Sourcepub fn get_flags(&self) -> MdbResult<EnvFlags>
pub fn get_flags(&self) -> MdbResult<EnvFlags>
Get flags of environment, which could be changed after it was opened use get_all_flags if you need also creation time flags
Sourcepub fn get_all_flags(&self) -> MdbResult<EnvCreateFlags>
pub fn get_all_flags(&self) -> MdbResult<EnvCreateFlags>
Get all flags of environment, including which were specified on creation See also get_flags if you’re interested only in modifiable flags
pub fn get_maxreaders(&self) -> MdbResult<c_uint>
pub fn get_maxkeysize(&self) -> c_int
Sourcepub fn copy_to_fd(&self, fd: mdb_filehandle_t) -> MdbResult<()>
pub fn copy_to_fd(&self, fd: mdb_filehandle_t) -> MdbResult<()>
Creates a backup copy in specified file descriptor
Sourcepub fn get_fd(&self) -> MdbResult<mdb_filehandle_t>
pub fn get_fd(&self) -> MdbResult<mdb_filehandle_t>
Gets file descriptor of this environment
Sourcepub fn copy_to_path<P: AsRef<Path>>(&self, path: P) -> MdbResult<()>
pub fn copy_to_path<P: AsRef<Path>>(&self, path: P) -> MdbResult<()>
Creates a backup copy in specified path
Sourcepub fn new_transaction(&self) -> MdbResult<Transaction<'_>>
pub fn new_transaction(&self) -> MdbResult<Transaction<'_>>
Creates a new read-write transaction
Use get_reader
to get much faster lock-free alternative
Sourcepub fn get_reader(&self) -> MdbResult<ReadonlyTransaction<'_>>
pub fn get_reader(&self) -> MdbResult<ReadonlyTransaction<'_>>
Creates a readonly transaction
Sourcepub fn create_db(&self, db_name: &str, flags: DbFlags) -> MdbResult<DbHandle>
pub fn create_db(&self, db_name: &str, flags: DbFlags) -> MdbResult<DbHandle>
Opens or creates a DB
Sourcepub fn get_default_db(&self, flags: DbFlags) -> MdbResult<DbHandle>
pub fn get_default_db(&self, flags: DbFlags) -> MdbResult<DbHandle>
Opens default DB with specified flags
Trait Implementations§
Source§impl Clone for Environment
impl Clone for Environment
Source§fn clone(&self) -> Environment
fn clone(&self) -> Environment
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more