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
.
Use Env::open_db
or EnvRw::create_db
to retrieve database handles
and EnvRw::txn_rw
to start a read-write transaction.
It’s possible to create a read-only handle by invoking Env::clone_ro
.
The environment is closed when the last handle is dropped.
Implementations
sourceimpl EnvRw
impl EnvRw
sourcepub unsafe fn create_dbs<'a, K, V, C>(
&mut self,
options: impl IntoIterator<IntoIter = impl Iterator<Item = &'a DbOptions<K, V, C, Option<CString>>> + ExactSizeIterator>
) -> Result<Vec<Db<K, V, C>>, Error> where
K: ?Sized + Storable,
V: ?Sized + Storable,
C: Constraint,
pub unsafe fn create_dbs<'a, K, V, C>(
&mut self,
options: impl IntoIterator<IntoIter = impl Iterator<Item = &'a DbOptions<K, V, C, Option<CString>>> + ExactSizeIterator>
) -> Result<Vec<Db<K, V, C>>, Error> where
K: ?Sized + Storable,
V: ?Sized + Storable,
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: &DbOptions<K, V, C, Option<CString>>
) -> Result<Db<K, V, C>, Error> where
K: ?Sized + Storable,
V: ?Sized + Storable,
C: Constraint,
pub unsafe fn create_db<K, V, C>(
&mut self,
options: &DbOptions<K, V, C, Option<CString>>
) -> Result<Db<K, V, C>, Error> 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.
Trait Implementations
sourceimpl Env for EnvRw
impl Env for EnvRw
sourcefn max_keysize(&self) -> usize
fn max_keysize(&self) -> usize
Get maximum size of keys and duplicate data
sourcefn valid_keysize<K>(&self, key: &K) -> bool where
K: ?Sized + Storable,
fn valid_keysize<K>(&self, key: &K) -> bool where
K: ?Sized + Storable,
Checks if key or duplicate data has valid size
sourceunsafe fn open_dbs<'a, K, V, C>(
&self,
options: impl IntoIterator<IntoIter = impl Iterator<Item = &'a DbOptions<K, V, C, Option<CString>>> + ExactSizeIterator>
) -> Result<Vec<Db<K, V, C>>, Error> where
K: ?Sized + Storable,
V: ?Sized + Storable,
C: Constraint,
unsafe fn open_dbs<'a, K, V, C>(
&self,
options: impl IntoIterator<IntoIter = impl Iterator<Item = &'a DbOptions<K, V, C, Option<CString>>> + ExactSizeIterator>
) -> Result<Vec<Db<K, V, C>>, Error> where
K: ?Sized + Storable,
V: ?Sized + Storable,
C: Constraint,
Open databases in environment Read more
impl Eq for EnvRw
impl StructuralEq for EnvRw
impl StructuralPartialEq for EnvRw
Auto Trait Implementations
impl RefUnwindSafe for EnvRw
impl Send for EnvRw
impl Sync for EnvRw
impl Unpin for EnvRw
impl UnwindSafe for EnvRw
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