Skip to main content

Database

Type Alias Database 

Source
pub type Database<E> = Immutable<E, Key, Value, Hasher, Translator, Merkleized<Hasher>, Durable>;
Expand description

Database type alias for the clean (merkleized, durable) state.

Aliased Type§

pub struct Database<E> { /* private fields */ }

Trait Implementations§

Source§

impl<E> Syncable for Database<E>
where E: Storage + Clock + Metrics,

Source§

type Operation = Operation<Digest, Digest>

The type of operations in the database.
Source§

fn create_test_operations(count: usize, seed: u64) -> Vec<Self::Operation>

Create test operations with the given count and seed. The returned operations must end with a commit operation.
Source§

async fn add_operations( self, operations: Vec<Self::Operation>, ) -> Result<Self, Error>

Add operations to the database and return the clean database, ignoring any input that doesn’t end with a commit operation (since without a commit, we can’t return a clean DB).
Source§

fn root(&self) -> Key

Get the database’s root digest.
Source§

fn size(&self) -> Location

Get the total number of operations in the database (including pruned operations).
Source§

fn inactivity_floor(&self) -> Location

Get the inactivity floor, the location below which all operations are inactive.
Source§

fn historical_proof( &self, op_count: Location, start_loc: Location, max_ops: NonZeroU64, ) -> impl Future<Output = Result<(Proof<Key>, Vec<Self::Operation>), Error>> + Send

Get historical proof and operations.
Source§

fn name() -> &'static str

Get the database type name for logging.