pub struct DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,{ /* private fields */ }Expand description
The deployment store.
Implementations§
Source§impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
Sourcepub fn open(
fee_store: FeeStore<N, <D as DeploymentStorage<N>>::FeeStorage>,
) -> Result<DeploymentStore<N, D>, Error>
pub fn open( fee_store: FeeStore<N, <D as DeploymentStorage<N>>::FeeStorage>, ) -> Result<DeploymentStore<N, D>, Error>
Initializes the deployment store.
Sourcepub fn from(storage: D) -> DeploymentStore<N, D>
pub fn from(storage: D) -> DeploymentStore<N, D>
Initializes a deployment store from storage.
Sourcepub fn insert(&self, transaction: &Transaction<N>) -> Result<(), Error>
pub fn insert(&self, transaction: &Transaction<N>) -> Result<(), Error>
Stores the given deployment transaction into storage.
Sourcepub fn remove(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<(), Error>
pub fn remove( &self, transaction_id: &<N as Network>::TransactionID, ) -> Result<(), Error>
Removes the transaction for the given transaction ID.
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<(), Error>
pub fn finish_atomic(&self) -> Result<(), Error>
Finishes an atomic batch write operation.
Source§impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
Sourcepub fn get_transaction(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Transaction<N>>, Error>
pub fn get_transaction( &self, transaction_id: &<N as Network>::TransactionID, ) -> Result<Option<Transaction<N>>, Error>
Returns the transaction for the given transaction ID.
Sourcepub fn get_deployment(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Deployment<N>>, Error>
pub fn get_deployment( &self, transaction_id: &<N as Network>::TransactionID, ) -> Result<Option<Deployment<N>>, Error>
Returns the deployment for the given transaction ID.
Sourcepub fn get_edition(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<u16>, Error>
pub fn get_edition( &self, program_id: &ProgramID<N>, ) -> Result<Option<u16>, Error>
Returns the edition for the given program ID.
Sourcepub fn get_program_id(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<ProgramID<N>>, Error>
pub fn get_program_id( &self, transaction_id: &<N as Network>::TransactionID, ) -> Result<Option<ProgramID<N>>, Error>
Returns the program ID for the given transaction ID.
Sourcepub fn get_program(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<ProgramCore<N, Instruction<N>, Command<N>>>, Error>
pub fn get_program( &self, program_id: &ProgramID<N>, ) -> Result<Option<ProgramCore<N, Instruction<N>, Command<N>>>, Error>
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>>, Error>
pub fn get_verifying_key( &self, program_id: &ProgramID<N>, function_name: &Identifier<N>, ) -> Result<Option<VerifyingKey<N>>, Error>
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>>, Error>
pub fn get_certificate( &self, program_id: &ProgramID<N>, function_name: &Identifier<N>, ) -> Result<Option<Certificate<N>>, Error>
Returns the certificate for the given (program ID, function name).
Source§impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
Sourcepub fn find_transaction_id_from_program_id(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<<N as Network>::TransactionID>, Error>
pub fn find_transaction_id_from_program_id( &self, program_id: &ProgramID<N>, ) -> Result<Option<<N as Network>::TransactionID>, Error>
Returns the transaction ID that deployed the given program ID.
Sourcepub fn find_transaction_id_from_transition_id(
&self,
transition_id: &<N as Network>::TransitionID,
) -> Result<Option<<N as Network>::TransactionID>, Error>
pub 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 deployed the given transition ID.
Source§impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
Source§impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
impl<N, D> DeploymentStore<N, D>where
N: Network,
D: DeploymentStorage<N>,
Sourcepub fn deployment_transaction_ids(
&self,
) -> impl Iterator<Item = Cow<'_, <N as Network>::TransactionID>>
pub fn deployment_transaction_ids( &self, ) -> impl Iterator<Item = Cow<'_, <N as Network>::TransactionID>>
Returns an iterator over the deployment transaction IDs, for all deployments.
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<'_, ProgramCore<N, Instruction<N>, Command<N>>>>
pub fn programs( &self, ) -> impl Iterator<Item = Cow<'_, ProgramCore<N, Instruction<N>, Command<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, D> Clone for DeploymentStore<N, D>
impl<N, D> Clone for DeploymentStore<N, D>
Source§fn clone(&self) -> DeploymentStore<N, D>
fn clone(&self) -> DeploymentStore<N, D>
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, D> Freeze for DeploymentStore<N, D>where
D: Freeze,
impl<N, D> RefUnwindSafe for DeploymentStore<N, D>where
D: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, D> Send for DeploymentStore<N, D>
impl<N, D> Sync for DeploymentStore<N, D>
impl<N, D> Unpin for DeploymentStore<N, D>
impl<N, D> UnwindSafe for DeploymentStore<N, D>where
D: UnwindSafe,
N: UnwindSafe,
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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