pub struct MemDb<H: Clone + Send + Sync + Eq + PartialEq + Default + Hash>(_);
Expand description

This implements Database as an in-memory hash map. commit is not atomic.

Implementations

Create a new instance

Count number of values in a column

Trait Implementations

Commit the transaction to the database atomically. Any further calls to get or lookup will reflect the new state. Read more

Retrieve the value previously stored against key or None if key is not currently in the database. Read more

Retrieve the first preimage previously stored for hash or None if no preimage is currently stored. Read more

Commit the transaction to the database atomically. Any further calls to get or lookup will reflect the new state. Read more

Check if the value exists in the database without retrieving it.

Call f with the value previously stored against key. Read more

Set the value of key in col to value, replacing anything that is there currently.

Remove the value of key in col.

Call f with the preimage stored for hash and return the result, or None if no preimage is currently stored. Read more

Store the preimage of hash into the database, so that it may be looked up later with Database::lookup. This may be called multiple times, but Database::lookup but subsequent calls will ignore preimage and simply increase the number of references on hash. Read more

Release the preimage of hash from the database. An equal number of these to the number of corresponding stores must have been given before it is legal for Database::lookup to be unable to provide the preimage. Read more

Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.