Struct cuprate_database::ConcreteEnv

source ·
pub struct ConcreteEnv { /* private fields */ }
Expand description

A strongly typed, concrete database environment, backed by heed.

Trait Implementations§

source§

impl Drop for ConcreteEnv

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Env for ConcreteEnv

source§

type TxRw<'tx> = RefCell<RwTxn<'tx>>

HACK: heed::RwTxn is wrapped in RefCell to allow:

  • opening a database with only a & to it
  • allowing 1 write tx to open multiple tables

Our mutable accesses are safe and will not panic as:

  • Write transactions are !Sync
  • A table operation does not hold a reference to the inner cell once the call is over
  • The function to manipulate the table takes the same type of reference that the RefCell gets for that function

Also see:

source§

const MANUAL_RESIZE: bool = true

Does the database backend need to be manually resized when the memory-map is full? Read more
source§

const SYNCS_PER_TX: bool = false

Does the database backend forcefully sync/flush to disk on every transaction commit? Read more
source§

type EnvInner<'env> = RwLockReadGuard<'env, Env>

The struct representing the actual backend’s database environment. Read more
source§

type TxRo<'tx> = RoTxn<'tx>

The read-only transaction type of the backend.
source§

fn open(config: Config) -> Result<Self, InitError>

Open the database environment, using the passed Config. Read more
source§

fn config(&self) -> &Config

Return the Config that this database was Env::opened with.
source§

fn sync(&self) -> Result<(), RuntimeError>

Fully sync the database caches to disk. Read more
source§

fn resize_map(&self, resize_algorithm: Option<ResizeAlgorithm>) -> NonZeroUsize

Resize the database’s memory map to a new (bigger) size using a ResizeAlgorithm. Read more
source§

fn current_map_size(&self) -> usize

What is the current size of the database’s memory map in bytes? Read more
source§

fn env_inner(&self) -> Self::EnvInner<'_>

source§

fn disk_size_bytes(&self) -> Result<u64>

Return the amount of actual of bytes the database is taking up on disk. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.

Layout§

Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...) attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.

Size: 112 bytes