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§
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 open<S: Clone + Into<StorageMode>>(storage: S) -> Result<Self>
fn open<S: Clone + Into<StorageMode>>(storage: S) -> Result<Self>
Initializes the consensus storage.
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 storage_mode(&self) -> &StorageMode
fn storage_mode(&self) -> &StorageMode
Returns the storage mode.
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.
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.