pub trait EnvRef {
// Required method
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.)