pub trait DeploymentStorage<N>:
Clone
+ Send
+ Syncwhere
N: Network,{
type IDMap: for<'a> Map<'a, <N as Network>::TransactionID, ProgramID<N>>;
type EditionMap: for<'a> Map<'a, ProgramID<N>, u16>;
type ReverseIDMap: for<'a> Map<'a, (ProgramID<N>, u16), <N as Network>::TransactionID>;
type OwnerMap: for<'a> Map<'a, (ProgramID<N>, u16), ProgramOwner<N>>;
type ProgramMap: for<'a> Map<'a, (ProgramID<N>, u16), ProgramCore<N, Instruction<N>, Command<N>>>;
type VerifyingKeyMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), VerifyingKey<N>>;
type CertificateMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), Certificate<N>>;
type FeeStorage: FeeStorage<N>;
Show 30 methods
// Required methods
fn open(fee_store: FeeStore<N, Self::FeeStorage>) -> Result<Self, Error>;
fn id_map(&self) -> &Self::IDMap;
fn edition_map(&self) -> &Self::EditionMap;
fn reverse_id_map(&self) -> &Self::ReverseIDMap;
fn owner_map(&self) -> &Self::OwnerMap;
fn program_map(&self) -> &Self::ProgramMap;
fn verifying_key_map(&self) -> &Self::VerifyingKeyMap;
fn certificate_map(&self) -> &Self::CertificateMap;
fn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>;
// Provided methods
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_program_id(
&self,
program_id: &ProgramID<N>,
) -> 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> { ... }
fn get_program_id(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<ProgramID<N>>, Error> { ... }
fn get_edition(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<u16>, Error> { ... }
fn get_program(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<ProgramCore<N, Instruction<N>, Command<N>>>, Error> { ... }
fn get_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
) -> Result<Option<VerifyingKey<N>>, Error> { ... }
fn get_certificate(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
) -> Result<Option<Certificate<N>>, Error> { ... }
fn get_deployment(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Deployment<N>>, Error> { ... }
fn get_fee(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Fee<N>>, Error> { ... }
fn get_owner(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<ProgramOwner<N>>, Error> { ... }
fn get_transaction(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Transaction<N>>, Error> { ... }
}Expand description
A trait for deployment storage.
Required Associated Types§
Sourcetype IDMap: for<'a> Map<'a, <N as Network>::TransactionID, ProgramID<N>>
type IDMap: for<'a> Map<'a, <N as Network>::TransactionID, ProgramID<N>>
The mapping of transaction ID to program ID.
Sourcetype EditionMap: for<'a> Map<'a, ProgramID<N>, u16>
type EditionMap: for<'a> Map<'a, ProgramID<N>, u16>
The mapping of program ID to edition.
Sourcetype ReverseIDMap: for<'a> Map<'a, (ProgramID<N>, u16), <N as Network>::TransactionID>
type ReverseIDMap: for<'a> Map<'a, (ProgramID<N>, u16), <N as Network>::TransactionID>
The mapping of (program ID, edition) to transaction ID.
Sourcetype OwnerMap: for<'a> Map<'a, (ProgramID<N>, u16), ProgramOwner<N>>
type OwnerMap: for<'a> Map<'a, (ProgramID<N>, u16), ProgramOwner<N>>
The mapping of (program ID, edition) to ProgramOwner.
Sourcetype ProgramMap: for<'a> Map<'a, (ProgramID<N>, u16), ProgramCore<N, Instruction<N>, Command<N>>>
type ProgramMap: for<'a> Map<'a, (ProgramID<N>, u16), ProgramCore<N, Instruction<N>, Command<N>>>
The mapping of (program ID, edition) to program.
Sourcetype VerifyingKeyMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), VerifyingKey<N>>
type VerifyingKeyMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), VerifyingKey<N>>
The mapping of (program ID, function name, edition) to verifying key.
Sourcetype CertificateMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), Certificate<N>>
type CertificateMap: for<'a> Map<'a, (ProgramID<N>, Identifier<N>, u16), Certificate<N>>
The mapping of (program ID, function name, edition) to certificate.
Sourcetype FeeStorage: FeeStorage<N>
type FeeStorage: FeeStorage<N>
The fee storage.
Required Methods§
Sourcefn open(fee_store: FeeStore<N, Self::FeeStorage>) -> Result<Self, Error>
fn open(fee_store: FeeStore<N, Self::FeeStorage>) -> Result<Self, Error>
Initializes the deployment storage.
Sourcefn edition_map(&self) -> &Self::EditionMap
fn edition_map(&self) -> &Self::EditionMap
Returns the edition map.
Sourcefn reverse_id_map(&self) -> &Self::ReverseIDMap
fn reverse_id_map(&self) -> &Self::ReverseIDMap
Returns the reverse ID map.
Sourcefn program_map(&self) -> &Self::ProgramMap
fn program_map(&self) -> &Self::ProgramMap
Returns the program map.
Sourcefn verifying_key_map(&self) -> &Self::VerifyingKeyMap
fn verifying_key_map(&self) -> &Self::VerifyingKeyMap
Returns the verifying key map.
Sourcefn certificate_map(&self) -> &Self::CertificateMap
fn certificate_map(&self) -> &Self::CertificateMap
Returns the certificate map.
Sourcefn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>
fn fee_store(&self) -> &FeeStore<N, Self::FeeStorage>
Returns the fee storage.
Provided Methods§
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 deployment transaction pair 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 deployment transaction for the given transaction 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 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 get_program_id(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<ProgramID<N>>, Error>
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.
Sourcefn get_edition(&self, program_id: &ProgramID<N>) -> Result<Option<u16>, Error>
fn get_edition(&self, program_id: &ProgramID<N>) -> Result<Option<u16>, Error>
Returns the edition for the given program ID.
Sourcefn get_program(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<ProgramCore<N, Instruction<N>, Command<N>>>, Error>
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.
Sourcefn get_verifying_key(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
) -> Result<Option<VerifyingKey<N>>, Error>
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 and function name.
Sourcefn get_certificate(
&self,
program_id: &ProgramID<N>,
function_name: &Identifier<N>,
) -> Result<Option<Certificate<N>>, Error>
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 and function name.
Sourcefn get_deployment(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Deployment<N>>, Error>
fn get_deployment( &self, transaction_id: &<N as Network>::TransactionID, ) -> Result<Option<Deployment<N>>, Error>
Returns the deployment for the given transaction ID.
Sourcefn get_fee(
&self,
transaction_id: &<N as Network>::TransactionID,
) -> Result<Option<Fee<N>>, Error>
fn get_fee( &self, transaction_id: &<N as Network>::TransactionID, ) -> Result<Option<Fee<N>>, Error>
Returns the fee for the given transaction ID.
Sourcefn get_owner(
&self,
program_id: &ProgramID<N>,
) -> Result<Option<ProgramOwner<N>>, Error>
fn get_owner( &self, program_id: &ProgramID<N>, ) -> Result<Option<ProgramOwner<N>>, Error>
Returns the owner for 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.