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(dev: Option<u16>) -> 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 dev(&self) -> Option<u16> { ... }
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§
sourcetype FinalizeStorage: FinalizeStorage<N>
type FinalizeStorage: FinalizeStorage<N>
The finalize storage.
sourcetype BlockStorage: BlockStorage<N, TransactionStorage = Self::TransactionStorage, TransitionStorage = Self::TransitionStorage>
type BlockStorage: BlockStorage<N, TransactionStorage = Self::TransactionStorage, TransitionStorage = Self::TransitionStorage>
The block storage.
sourcetype TransactionStorage: TransactionStorage<N, TransitionStorage = Self::TransitionStorage>
type TransactionStorage: TransactionStorage<N, TransitionStorage = Self::TransitionStorage>
The transaction storage.
sourcetype TransitionStorage: TransitionStorage<N>
type TransitionStorage: TransitionStorage<N>
The transition storage.
Required Methods§
sourcefn finalize_store(&self) -> &FinalizeStore<N, Self::FinalizeStorage>
fn finalize_store(&self) -> &FinalizeStore<N, Self::FinalizeStorage>
Returns the finalize storage.
sourcefn block_store(&self) -> &BlockStore<N, Self::BlockStorage>
fn block_store(&self) -> &BlockStore<N, Self::BlockStorage>
Returns the block storage.
Provided Methods§
sourcefn transaction_store(&self) -> &TransactionStore<N, Self::TransactionStorage>
fn transaction_store(&self) -> &TransactionStore<N, Self::TransactionStorage>
Returns the transaction store.
sourcefn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>
fn transition_store(&self) -> &TransitionStore<N, Self::TransitionStorage>
Returns the transition store.
sourcefn start_atomic(&self)
fn start_atomic(&self)
Starts an atomic batch write operation.
sourcefn is_atomic_in_progress(&self) -> bool
fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
sourcefn atomic_checkpoint(&self)
fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
sourcefn clear_latest_checkpoint(&self)
fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
sourcefn atomic_rewind(&self)
fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
sourcefn abort_atomic(&self)
fn abort_atomic(&self)
Aborts an atomic batch write operation.
sourcefn finish_atomic(&self) -> Result<()>
fn finish_atomic(&self) -> Result<()>
Finishes an atomic batch write operation.
Object Safety§
This trait is not object safe.