pub trait ExecutionStorage<N: Network>:
Clone
+ Send
+ Sync {
type IDMap: for<'a> Map<'a, N::TransactionID, (Vec<N::TransitionID>, bool)>;
type ReverseIDMap: for<'a> Map<'a, N::TransitionID, N::TransactionID>;
type InclusionMap: for<'a> Map<'a, N::TransactionID, (N::StateRoot, Option<Proof<N>>)>;
type FeeStorage: FeeStorage<N>;
Show 19 methods
// Required methods
fn open(fee_store: FeeStore<N, Self::FeeStorage>) -> Result<Self>;
fn id_map(&self) -> &Self::IDMap;
fn reverse_id_map(&self) -> &Self::ReverseIDMap;
fn inclusion_map(&self) -> &Self::InclusionMap;
fn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>;
// Provided methods
fn transition_store(
&self,
) -> &TransitionStore<N, <Self::FeeStorage as FeeStorage<N>>::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<()> { ... }
fn insert(&self, transaction: &Transaction<N>) -> Result<()> { ... }
fn remove(&self, transaction_id: &N::TransactionID) -> Result<()> { ... }
fn find_transaction_id_from_transition_id(
&self,
transition_id: &N::TransitionID,
) -> Result<Option<N::TransactionID>> { ... }
fn get_execution(
&self,
transaction_id: &N::TransactionID,
) -> Result<Option<Execution<N>>> { ... }
fn get_transaction(
&self,
transaction_id: &N::TransactionID,
) -> Result<Option<Transaction<N>>> { ... }
}
Expand description
A trait for execution storage.
Required Associated Types§
Sourcetype IDMap: for<'a> Map<'a, N::TransactionID, (Vec<N::TransitionID>, bool)>
type IDMap: for<'a> Map<'a, N::TransactionID, (Vec<N::TransitionID>, bool)>
The mapping of transaction ID
to ([transition ID], has_fee)
.
Sourcetype ReverseIDMap: for<'a> Map<'a, N::TransitionID, N::TransactionID>
type ReverseIDMap: for<'a> Map<'a, N::TransitionID, N::TransactionID>
The mapping of transition ID
to transaction ID
.
Sourcetype InclusionMap: for<'a> Map<'a, N::TransactionID, (N::StateRoot, Option<Proof<N>>)>
type InclusionMap: for<'a> Map<'a, N::TransactionID, (N::StateRoot, Option<Proof<N>>)>
The mapping of transaction ID
to (global state root, (optional) proof)
.
Sourcetype FeeStorage: FeeStorage<N>
type FeeStorage: FeeStorage<N>
The fee storage.
Required Methods§
Sourcefn open(fee_store: FeeStore<N, Self::FeeStorage>) -> Result<Self>
fn open(fee_store: FeeStore<N, Self::FeeStorage>) -> Result<Self>
Initializes the execution storage.
Sourcefn reverse_id_map(&self) -> &Self::ReverseIDMap
fn reverse_id_map(&self) -> &Self::ReverseIDMap
Returns the reverse ID map.
Sourcefn inclusion_map(&self) -> &Self::InclusionMap
fn inclusion_map(&self) -> &Self::InclusionMap
Returns the inclusion map.
Sourcefn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>
fn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>
Returns the fee store.
Provided Methods§
Sourcefn transition_store(
&self,
) -> &TransitionStore<N, <Self::FeeStorage as FeeStorage<N>>::TransitionStorage>
fn transition_store( &self, ) -> &TransitionStore<N, <Self::FeeStorage as FeeStorage<N>>::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.
Sourcefn insert(&self, transaction: &Transaction<N>) -> Result<()>
fn insert(&self, transaction: &Transaction<N>) -> Result<()>
Stores the given execution transaction
pair into storage.
Sourcefn remove(&self, transaction_id: &N::TransactionID) -> Result<()>
fn remove(&self, transaction_id: &N::TransactionID) -> Result<()>
Removes the execution transaction for the given transaction ID
.
Sourcefn find_transaction_id_from_transition_id(
&self,
transition_id: &N::TransitionID,
) -> Result<Option<N::TransactionID>>
fn find_transaction_id_from_transition_id( &self, transition_id: &N::TransitionID, ) -> Result<Option<N::TransactionID>>
Returns the transaction ID that contains the given transition ID
.
Sourcefn get_execution(
&self,
transaction_id: &N::TransactionID,
) -> Result<Option<Execution<N>>>
fn get_execution( &self, transaction_id: &N::TransactionID, ) -> Result<Option<Execution<N>>>
Returns the execution for the given transaction ID
.
Sourcefn get_transaction(
&self,
transaction_id: &N::TransactionID,
) -> Result<Option<Transaction<N>>>
fn get_transaction( &self, transaction_id: &N::TransactionID, ) -> Result<Option<Transaction<N>>>
Returns the transaction for the given transaction ID
.
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.