pub trait EnvRef {
// Required methods
unsafe fn open_or_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: Storable + ?Sized + 'a,
V: Storable + ?Sized + 'a,
C: Constraint;
unsafe fn open_or_create_db<K, V, C>(
&mut self,
options: &DbSpec<K, V, C>
) -> Result<Db<K, V, C>>
where K: Storable + ?Sized,
V: Storable + ?Sized,
C: Constraint;
}
Expand description
Abstraction over &EnvRo
and &mut EnvRw
, which allows
creating databases in the latter case if non-existing
This trait is only needed if you want to create generic code which works on
either &EnvRo
or &mut EnvRw
and creates databases in the latter case if
non-existing.
In most cases, EnvRo
or EnvRw
can be used directly. (Note that you can
call EnvRo
’s methods on EnvRw
automatically due to Deref
coercion.)
Required Methods§
sourceunsafe fn open_or_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: Storable + ?Sized + 'a,
V: Storable + ?Sized + 'a,
C: Constraint,
unsafe fn open_or_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: Storable + ?Sized + 'a, V: Storable + ?Sized + 'a, C: Constraint,
👎Deprecated since 0.14.1: use <code>EnvRef::open_or_create_db</code>
sourceunsafe fn open_or_create_db<K, V, C>(
&mut self,
options: &DbSpec<K, V, C>
) -> Result<Db<K, V, C>>where
K: Storable + ?Sized,
V: Storable + ?Sized,
C: Constraint,
unsafe fn open_or_create_db<K, V, C>( &mut self, options: &DbSpec<K, V, C> ) -> Result<Db<K, V, C>>where K: Storable + ?Sized, V: Storable + ?Sized, C: Constraint,
Implementations on Foreign Types§
source§impl<T: Env> EnvRef for &T
impl<T: Env> EnvRef for &T
source§unsafe fn open_or_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: Storable + ?Sized + 'a,
V: Storable + ?Sized + 'a,
C: Constraint,
unsafe fn open_or_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: Storable + ?Sized + 'a, V: Storable + ?Sized + 'a, C: Constraint,
👎Deprecated since 0.14.1: use <code>EnvRef::open_or_create_db</code>