Struct ord_lmdb_rs::core::Environment
source · [−]pub struct Environment { /* private fields */ }
Expand description
Represents LMDB Environment. Should be opened using EnvBuilder
Implementations
sourceimpl 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
sourceimpl Clone for Environment
impl Clone for Environment
sourcefn clone(&self) -> Environment
fn clone(&self) -> Environment
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for Environment
impl Debug for Environment
impl Send for Environment
impl Sync for Environment
Auto Trait Implementations
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more