snarkvm_ledger_store

Trait ConsensusStorage

Source
pub trait ConsensusStorage<N: Network>:
    'static
    + Clone
    + Send
    + Sync {
    type FinalizeStorage: FinalizeStorage<N>;
    type BlockStorage: BlockStorage<N, TransactionStorage = Self::TransactionStorage, TransitionStorage = Self::TransitionStorage>;
    type TransactionStorage: TransactionStorage<N, TransitionStorage = Self::TransitionStorage>;
    type TransitionStorage: TransitionStorage<N>;

Show 13 methods // Required methods fn open<S: Clone + Into<StorageMode>>(storage: S) -> Result<Self>; fn finalize_store(&self) -> &FinalizeStore<N, Self::FinalizeStorage>; fn block_store(&self) -> &BlockStore<N, Self::BlockStorage>; // Provided methods fn transaction_store( &self, ) -> &TransactionStore<N, Self::TransactionStorage> { ... } fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage> { ... } fn storage_mode(&self) -> &StorageMode { ... } fn start_atomic(&self) { ... } fn is_atomic_in_progress(&self) -> bool { ... } fn atomic_checkpoint(&self) { ... } fn clear_latest_checkpoint(&self) { ... } fn atomic_rewind(&self) { ... } fn abort_atomic(&self) { ... } fn finish_atomic(&self) -> Result<()> { ... }
}
Expand description

A trait for consensus storage.

Required Associated Types§

Source

type FinalizeStorage: FinalizeStorage<N>

The finalize storage.

Source

type BlockStorage: BlockStorage<N, TransactionStorage = Self::TransactionStorage, TransitionStorage = Self::TransitionStorage>

The block storage.

Source

type TransactionStorage: TransactionStorage<N, TransitionStorage = Self::TransitionStorage>

The transaction storage.

Source

type TransitionStorage: TransitionStorage<N>

The transition storage.

Required Methods§

Source

fn open<S: Clone + Into<StorageMode>>(storage: S) -> Result<Self>

Initializes the consensus storage.

Source

fn finalize_store(&self) -> &FinalizeStore<N, Self::FinalizeStorage>

Returns the finalize storage.

Source

fn block_store(&self) -> &BlockStore<N, Self::BlockStorage>

Returns the block storage.

Provided Methods§

Source

fn transaction_store(&self) -> &TransactionStore<N, Self::TransactionStorage>

Returns the transaction store.

Source

fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>

Returns the transition store.

Source

fn storage_mode(&self) -> &StorageMode

Returns the storage mode.

Source

fn start_atomic(&self)

Starts an atomic batch write operation.

Source

fn is_atomic_in_progress(&self) -> bool

Checks if an atomic batch is in progress.

Source

fn atomic_checkpoint(&self)

Checkpoints the atomic batch.

Source

fn clear_latest_checkpoint(&self)

Clears the latest atomic batch checkpoint.

Source

fn atomic_rewind(&self)

Rewinds the atomic batch to the previous checkpoint.

Source

fn abort_atomic(&self)

Aborts an atomic batch write operation.

Source

fn finish_atomic(&self) -> Result<()>

Finishes an atomic batch write operation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§