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_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,
Trait Implementations§
source§impl Env for EnvRw
impl Env for EnvRw
source§fn max_keysize(&self) -> usize
fn max_keysize(&self) -> usize
Get maximum size of keys and duplicate data
source§fn valid_keysize<'kr, K, KRef>(&self, key: KRef) -> boolwhere
K: ?Sized + Storable + 'kr,
KRef: StorableRef<'kr, K>,
fn valid_keysize<'kr, K, KRef>(&self, key: KRef) -> boolwhere K: ?Sized + Storable + 'kr, KRef: StorableRef<'kr, K>,
Checks if key or duplicate data has valid size