pub struct EnvRw { /* private fields */ }
Expand description
Read-write handle for accessing environment that stores key-value databases
An environment can be opened using EnvBuilder
.
The methods for read-only access are accessible through the Env
trait
(which is implemented by EnvRo
and EnvRw
).
Methods for write access, however, are available directly on the EnvRw
struct.
Use Env::open_db
or EnvRw::create_db
to retrieve database handles
and EnvRw::txn_rw
to start a read-write transaction.
It’s also possible to create a read-only handle from a read-write handle by
invoking Env::clone_ro
.
Implementations§
source§impl EnvRw
impl EnvRw
sourcepub fn nestable_txns(&self) -> bool
pub fn nestable_txns(&self) -> bool
Check if transactions are nestable
See TxnRw::nested
.
sourcepub unsafe fn create_dbs<'a, K, V, C>(
&mut self,
options: impl IntoIterator<IntoIter = impl Iterator<Item = &'a DbSpec<K, V, C>> + ExactSizeIterator>
) -> Result<Vec<Db<K, V, C>>>where
K: ?Sized + Storable + 'a,
V: ?Sized + Storable + 'a,
C: Constraint,
pub unsafe fn create_dbs<'a, K, V, C>( &mut self, options: impl IntoIterator<IntoIter = impl Iterator<Item = &'a DbSpec<K, V, C>> + ExactSizeIterator> ) -> Result<Vec<Db<K, V, C>>>where K: ?Sized + Storable + 'a, V: ?Sized + Storable + 'a, C: Constraint,
Open databases in environment and create if non-existing
SAFETY: If a database exists already, it must have been created with compatible options.
sourcepub unsafe fn create_db<K, V, C>(
&mut self,
options: &DbSpec<K, V, C>
) -> Result<Db<K, V, C>>where
K: ?Sized + Storable,
V: ?Sized + Storable,
C: Constraint,
pub unsafe fn create_db<K, V, C>( &mut self, options: &DbSpec<K, V, C> ) -> Result<Db<K, V, C>>where K: ?Sized + Storable, V: ?Sized + Storable, C: Constraint,
Open database in environment and create if non-existing
SAFETY: If a database exists already, it must have been created with compatible options.