pub trait Env: AsRef<EnvRo> {
// Required methods
fn txn_ro(&self) -> Result<TxnRo<'_>>;
fn max_keysize(&self) -> usize;
fn valid_keysize<'kr, K, KRef>(&self, key: KRef) -> bool
where K: ?Sized + Storable + 'kr,
KRef: StorableRef<'kr, K>;
unsafe fn open_db<K, V, C>(
&self,
options: &DbSpec<K, V, C>
) -> Result<Db<K, V, C>>
where K: ?Sized + Storable,
V: ?Sized + Storable,
C: Constraint;
fn clear_stale_readers(&self) -> Result<usize>;
// Provided methods
fn as_env_ro(&self) -> &EnvRo { ... }
fn clone_ro(&self) -> EnvRo { ... }
}
Expand description
Required Methods§
sourcefn max_keysize(&self) -> usize
fn max_keysize(&self) -> usize
Get maximum size of keys and duplicate data
sourcefn 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
sourceunsafe fn open_db<K, V, C>(
&self,
options: &DbSpec<K, V, C>
) -> Result<Db<K, V, C>>where
K: ?Sized + Storable,
V: ?Sized + Storable,
C: Constraint,
unsafe fn open_db<K, V, C>( &self, options: &DbSpec<K, V, C> ) -> Result<Db<K, V, C>>where K: ?Sized + Storable, V: ?Sized + Storable, C: Constraint,
sourcefn clear_stale_readers(&self) -> Result<usize>
fn clear_stale_readers(&self) -> Result<usize>
Clear stale readers
Refer to LMDB’s documentation when to clear stale readers