[][src]Struct libradb::LibraDB

pub struct LibraDB { /* fields omitted */ }

This holds a handle to the underlying DB responsible for physical storage and provides APIs for access to the core Libra data structures.

Implementations

impl LibraDB[src]

pub fn open<P: AsRef<Path> + Clone>(
    db_root_path: P,
    readonly: bool,
    prune_window: Option<u64>,
    rocksdb_config: RocksdbConfig
) -> Result<Self>
[src]

pub fn open_as_secondary<P: AsRef<Path> + Clone>(
    db_root_path: P,
    secondary_path: P,
    rocksdb_config: RocksdbConfig
) -> Result<Self>
[src]

pub fn new_for_test<P: AsRef<Path> + Clone>(db_root_path: P) -> Self[src]

This opens db in non-readonly mode, without the pruner.

pub fn get_backup_handler(&self) -> BackupHandler[src]

Gets an instance of BackupHandler for data backup purpose.

Trait Implementations

impl DbReader for LibraDB[src]

fn get_txn_by_account(
    &self,
    address: AccountAddress,
    seq_num: u64,
    ledger_version: Version,
    fetch_events: bool
) -> Result<Option<TransactionWithProof>>
[src]

Returns a transaction that is the seq_num-th one associated with the given account. If the transaction with given seq_num doesn't exist, returns None.

fn get_transactions(
    &self,
    start_version: Version,
    limit: u64,
    ledger_version: Version,
    fetch_events: bool
) -> Result<TransactionListWithProof>
[src]

Gets a batch of transactions for the purpose of synchronizing state to another node.

This is used by the State Synchronizer module internally.

fn get_epoch_ending_ledger_info(
    &self,
    version: u64
) -> Result<LedgerInfoWithSignatures>
[src]

Gets ledger info at specified version and ensures it's an epoch ending.

impl DbWriter for LibraDB[src]

fn save_transactions(
    &self,
    txns_to_commit: &[TransactionToCommit],
    first_version: Version,
    ledger_info_with_sigs: Option<&LedgerInfoWithSignatures>
) -> Result<()>
[src]

first_version is the version of the first transaction in txns_to_commit. When ledger_info_with_sigs is provided, verify that the transaction accumulator root hash it carries is generated after the txns_to_commit are applied. Note that even if txns_to_commit is empty, frist_version is checked to be ledger_info_with_sigs.ledger_info.version + 1 if ledger_info_with_sigs is not None.

impl Debug for LibraDB[src]

Auto Trait Implementations

impl !RefUnwindSafe for LibraDB

impl Send for LibraDB

impl Sync for LibraDB

impl Unpin for LibraDB

impl !UnwindSafe for LibraDB

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Pointable for T

type Init = T

The type for initializers.

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,