Struct journaldb::overlaydb::OverlayDB[][src]

pub struct OverlayDB { /* fields omitted */ }

Implementation of the HashDB trait for a disk-backed database with a memory overlay.

The operations insert() and remove() take place on the memory overlay; batches of such operations may be flushed to the disk-backed DB with commit() or discarded with revert().

lookup() and contains() maintain normal behaviour - all insert() and remove() queries have an immediate effect in terms of these functions.

Methods

impl OverlayDB
[src]

Create a new instance of OverlayDB given a backing database.

Commit all operations to given batch.

Revert all operations on this object (i.e. insert()s and remove()s) since the last commit().

Get the number of references that would be committed.

Trait Implementations

impl AsHashDB<KeccakHasher> for OverlayDB
[src]

Perform upcast to HashDB for anything that derives from HashDB.

Perform mutable upcast to HashDB for anything that derives from HashDB.

impl Clone for OverlayDB
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl HashDB<KeccakHasher> for OverlayDB
[src]

Get the keys in the database together with number of underlying references.

Look up a given hash into the bytes that hash to it, returning None if the hash is not known. Read more

Check for the existance of a hash-key.

Insert a datum item into the DB and return the datum's hash for a later lookup. Insertions are counted and the equivalent number of remove()s must be performed before the data is considered dead. Read more

Like insert(), except you provide the key and the data is all moved.

Remove a datum previously inserted. Insertions can be "owed" such that the same number of insert()s may happen without the data being eventually being inserted into the DB. It can be "owed" more than once. Read more

Auto Trait Implementations

impl Send for OverlayDB

impl Sync for OverlayDB