pub struct TransactionStore<N: Network, T: TransactionStorage<N>> { /* private fields */ }
Expand description
The transaction store.
Implementations§
Source§impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
Sourcepub fn open(
transition_store: TransitionStore<N, T::TransitionStorage>,
) -> Result<Self>
pub fn open( transition_store: TransitionStore<N, T::TransitionStorage>, ) -> Result<Self>
Initializes the transaction store.
Sourcepub fn insert(&self, transaction: &Transaction<N>) -> Result<()>
pub fn insert(&self, transaction: &Transaction<N>) -> Result<()>
Stores the given transaction
into storage.
Sourcepub fn remove(&self, transaction_id: &N::TransactionID) -> Result<()>
pub fn remove(&self, transaction_id: &N::TransactionID) -> Result<()>
Removes the transaction for the given transaction ID
.
Sourcepub fn deployment_store(&self) -> &DeploymentStore<N, T::DeploymentStorage>
pub fn deployment_store(&self) -> &DeploymentStore<N, T::DeploymentStorage>
Returns the deployment store.
Sourcepub fn transition_store(&self) -> &TransitionStore<N, T::TransitionStorage>
pub fn transition_store(&self) -> &TransitionStore<N, T::TransitionStorage>
Returns the transition store.
Sourcepub fn start_atomic(&self)
pub fn start_atomic(&self)
Starts an atomic batch write operation.
Sourcepub fn is_atomic_in_progress(&self) -> bool
pub fn is_atomic_in_progress(&self) -> bool
Checks if an atomic batch is in progress.
Sourcepub fn atomic_checkpoint(&self)
pub fn atomic_checkpoint(&self)
Checkpoints the atomic batch.
Sourcepub fn clear_latest_checkpoint(&self)
pub fn clear_latest_checkpoint(&self)
Clears the latest atomic batch checkpoint.
Sourcepub fn atomic_rewind(&self)
pub fn atomic_rewind(&self)
Rewinds the atomic batch to the previous checkpoint.
Sourcepub fn abort_atomic(&self)
pub fn abort_atomic(&self)
Aborts an atomic batch write operation.
Sourcepub fn finish_atomic(&self) -> Result<()>
pub fn finish_atomic(&self) -> Result<()>
Finishes an atomic batch write operation.
Sourcepub fn storage_mode(&self) -> &StorageMode
pub fn storage_mode(&self) -> &StorageMode
Returns the storage mode.
Source§impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
Sourcepub fn get_transaction(
&self,
transaction_id: &N::TransactionID,
) -> Result<Option<Transaction<N>>>
pub fn get_transaction( &self, transaction_id: &N::TransactionID, ) -> Result<Option<Transaction<N>>>
Returns the transaction for the given transaction ID
.
Sourcepub fn get_deployment(
&self,
transaction_id: &N::TransactionID,
) -> Result<Option<Deployment<N>>>
pub fn get_deployment( &self, transaction_id: &N::TransactionID, ) -> Result<Option<Deployment<N>>>
Returns the deployment for the given transaction ID
.
Sourcepub fn get_execution(
&self,
transaction_id: &N::TransactionID,
) -> Result<Option<Execution<N>>>
pub fn get_execution( &self, transaction_id: &N::TransactionID, ) -> Result<Option<Execution<N>>>
Returns the execution for the given transaction ID
.
Sourcepub fn get_edition(
&self,
transaction_id: &N::TransactionID,
) -> Result<Option<u16>>
pub fn get_edition( &self, transaction_id: &N::TransactionID, ) -> Result<Option<u16>>
Returns the edition for the given transaction ID
.
Sourcepub fn get_program_id(
&self,
transaction_id: &N::TransactionID,
) -> Result<Option<ProgramID<N>>>
pub fn get_program_id( &self, transaction_id: &N::TransactionID, ) -> Result<Option<ProgramID<N>>>
Returns the program ID for the given transaction ID
.
Sourcepub fn get_program(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<Program<N>>>
pub fn get_program( &self, program_id: &ProgramID<N>, ) -> Result<Option<Program<N>>>
Returns the program for the given program ID
.
Sourcepub fn get_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
) -> Result<Option<VerifyingKey<N>>>
pub fn get_verifying_key( &self, program_id: &ProgramID<N>, function_name: &Identifier<N>, ) -> Result<Option<VerifyingKey<N>>>
Returns the verifying key for the given (program ID, function name)
.
Sourcepub fn get_certificate(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
) -> Result<Option<Certificate<N>>>
pub fn get_certificate( &self, program_id: &ProgramID<N>, function_name: &Identifier<N>, ) -> Result<Option<Certificate<N>>>
Returns the certificate for the given (program ID, function name)
.
Source§impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
Sourcepub fn find_transaction_id_from_program_id(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<N::TransactionID>>
pub fn find_transaction_id_from_program_id( &self, program_id: &ProgramID<N>, ) -> Result<Option<N::TransactionID>>
Returns the transaction ID that contains the given program ID
.
Sourcepub fn find_transaction_id_from_transition_id(
&self,
transition_id: &N::TransitionID,
) -> Result<Option<N::TransactionID>>
pub 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
.
Source§impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
Sourcepub fn contains_transaction_id(
&self,
transaction_id: &N::TransactionID,
) -> Result<bool>
pub fn contains_transaction_id( &self, transaction_id: &N::TransactionID, ) -> Result<bool>
Returns true
if the given transaction ID exists.
Sourcepub fn contains_program_id(&self, program_id: &ProgramID<N>) -> Result<bool>
pub fn contains_program_id(&self, program_id: &ProgramID<N>) -> Result<bool>
Returns true
if the given program ID exists.
Source§impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
impl<N: Network, T: TransactionStorage<N>> TransactionStore<N, T>
Sourcepub fn transaction_ids(
&self,
) -> impl '_ + Iterator<Item = Cow<'_, N::TransactionID>>
pub fn transaction_ids( &self, ) -> impl '_ + Iterator<Item = Cow<'_, N::TransactionID>>
Returns an iterator over the transaction IDs, for all transactions.
Sourcepub fn deployment_transaction_ids(
&self,
) -> impl '_ + Iterator<Item = Cow<'_, N::TransactionID>>
pub fn deployment_transaction_ids( &self, ) -> impl '_ + Iterator<Item = Cow<'_, N::TransactionID>>
Returns an iterator over the deployment transaction IDs, for all deployments.
Sourcepub fn execution_transaction_ids(
&self,
) -> impl '_ + Iterator<Item = Cow<'_, N::TransactionID>>
pub fn execution_transaction_ids( &self, ) -> impl '_ + Iterator<Item = Cow<'_, N::TransactionID>>
Returns an iterator over the execution transaction IDs, for all executions.
Sourcepub fn program_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, ProgramID<N>>>
pub fn program_ids(&self) -> impl '_ + Iterator<Item = Cow<'_, ProgramID<N>>>
Returns an iterator over the program IDs, for all deployments.
Sourcepub fn programs(&self) -> impl '_ + Iterator<Item = Cow<'_, Program<N>>>
pub fn programs(&self) -> impl '_ + Iterator<Item = Cow<'_, Program<N>>>
Returns an iterator over the programs, for all deployments.
Sourcepub fn verifying_keys(
&self,
) -> impl '_ + Iterator<Item = (Cow<'_, (ProgramID<N>, Identifier<N>, u16)>, Cow<'_, VerifyingKey<N>>)>
pub fn verifying_keys( &self, ) -> impl '_ + Iterator<Item = (Cow<'_, (ProgramID<N>, Identifier<N>, u16)>, Cow<'_, VerifyingKey<N>>)>
Returns an iterator over the ((program ID, function name, edition), verifying key)
, for all deployments.
Sourcepub fn certificates(
&self,
) -> impl '_ + Iterator<Item = (Cow<'_, (ProgramID<N>, Identifier<N>, u16)>, Cow<'_, Certificate<N>>)>
pub fn certificates( &self, ) -> impl '_ + Iterator<Item = (Cow<'_, (ProgramID<N>, Identifier<N>, u16)>, Cow<'_, Certificate<N>>)>
Returns an iterator over the ((program ID, function name, edition), certificate)
, for all deployments.
Trait Implementations§
Source§impl<N: Clone + Network, T: Clone + TransactionStorage<N>> Clone for TransactionStore<N, T>
impl<N: Clone + Network, T: Clone + TransactionStorage<N>> Clone for TransactionStore<N, T>
Source§fn clone(&self) -> TransactionStore<N, T>
fn clone(&self) -> TransactionStore<N, T>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<N, T> Freeze for TransactionStore<N, T>
impl<N, T> RefUnwindSafe for TransactionStore<N, T>
impl<N, T> Send for TransactionStore<N, T>
impl<N, T> Sync for TransactionStore<N, T>
impl<N, T> Unpin for TransactionStore<N, T>
impl<N, T> UnwindSafe for TransactionStore<N, T>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more