pub trait TransactionStorage<N>:
Clone
+ Send
+ Syncwhere
N: Network,{
type IDMap: for<'a> Map<'a, <N as Network>::TransactionID, TransactionType>;
type DeploymentStorage: DeploymentStorage<N, FeeStorage = Self::FeeStorage>;
type ExecutionStorage: ExecutionStorage<N, FeeStorage = Self::FeeStorage>;
type FeeStorage: FeeStorage<N, TransitionStorage = Self::TransitionStorage>;
type TransitionStorage: TransitionStorage<N>;
Show 19 methods
// Required methods
fn open(
transition_store: TransitionStore<N, Self::TransitionStorage>,
) -> Result<Self, Error>;
fn id_map(&self) -> &Self::IDMap;
fn deployment_store(&self) -> &DeploymentStore<N, Self::DeploymentStorage>;
fn execution_store(&self) -> &ExecutionStore<N, Self::ExecutionStorage>;
fn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>;
// Provided methods
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<(), Error> { ... }
fn insert(&self, transaction: &Transaction<N>) -> Result<(), Error> { ... }
fn remove(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<(), Error> { ... }
fn find_transaction_id_from_transition_id(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<Option<<N as Network>::TransactionID>, Error> { ... }
fn find_transaction_id_from_program_id(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<<N as Network>::TransactionID>, Error> { ... }
fn get_transaction(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Transaction<N>>, Error> { ... }
}Expand description
A trait for transaction storage.
Required Associated Types§
Sourcetype IDMap: for<'a> Map<'a, <N as Network>::TransactionID, TransactionType>
type IDMap: for<'a> Map<'a, <N as Network>::TransactionID, TransactionType>
The mapping of transaction ID to transaction type.
Sourcetype DeploymentStorage: DeploymentStorage<N, FeeStorage = Self::FeeStorage>
type DeploymentStorage: DeploymentStorage<N, FeeStorage = Self::FeeStorage>
The deployment storage.
Sourcetype ExecutionStorage: ExecutionStorage<N, FeeStorage = Self::FeeStorage>
type ExecutionStorage: ExecutionStorage<N, FeeStorage = Self::FeeStorage>
The execution storage.
Sourcetype FeeStorage: FeeStorage<N, TransitionStorage = Self::TransitionStorage>
type FeeStorage: FeeStorage<N, TransitionStorage = Self::TransitionStorage>
The fee storage.
Sourcetype TransitionStorage: TransitionStorage<N>
type TransitionStorage: TransitionStorage<N>
The transition storage.
Required Methods§
Sourcefn open(
transition_store: TransitionStore<N, Self::TransitionStorage>,
) -> Result<Self, Error>
fn open( transition_store: TransitionStore<N, Self::TransitionStorage>, ) -> Result<Self, Error>
Initializes the transaction storage.
Sourcefn deployment_store(&self) -> &DeploymentStore<N, Self::DeploymentStorage>
fn deployment_store(&self) -> &DeploymentStore<N, Self::DeploymentStorage>
Returns the deployment store.
Sourcefn execution_store(&self) -> &ExecutionStore<N, Self::ExecutionStorage>
fn execution_store(&self) -> &ExecutionStore<N, Self::ExecutionStorage>
Returns the execution store.
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::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<(), Error>
fn finish_atomic(&self) -> Result<(), Error>
Finishes an atomic batch write operation.
Sourcefn insert(&self, transaction: &Transaction<N>) -> Result<(), Error>
fn insert(&self, transaction: &Transaction<N>) -> Result<(), Error>
Stores the given transaction into storage.
Sourcefn remove(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<(), Error>
fn remove( &self, transaction_id: &<N as Network>::TransactionID, ) -> Result<(), Error>
Removes the transaction for the given transaction ID.
Sourcefn find_transaction_id_from_transition_id(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<Option<<N as Network>::TransactionID>, Error>
fn find_transaction_id_from_transition_id( &self, transition_id: &<N as Network>::TransitionID, ) -> Result<Option<<N as Network>::TransactionID>, Error>
Returns the transaction ID that contains the given transition ID.
Sourcefn find_transaction_id_from_program_id(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<<N as Network>::TransactionID>, Error>
fn find_transaction_id_from_program_id( &self, program_id: &ProgramID<N>, ) -> Result<Option<<N as Network>::TransactionID>, Error>
Returns the transaction ID that contains the given program ID.
Sourcefn get_transaction(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Transaction<N>>, Error>
fn get_transaction( &self, transaction_id: &<N as Network>::TransactionID, ) -> Result<Option<Transaction<N>>, Error>
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.