Struct stacks_rpc_client::clarity::vm::database::sqlite::MemoryBackingStore
pub struct MemoryBackingStore { /* private fields */ }
Implementations§
§impl MemoryBackingStore
impl MemoryBackingStore
pub fn new() -> MemoryBackingStore
pub fn as_clarity_db<'a>(&'a mut self) -> ClarityDatabase<'a>
pub fn as_analysis_db<'a>(&'a mut self) -> AnalysisDatabase<'a>
Trait Implementations§
§impl ClarityBackingStore for MemoryBackingStore
impl ClarityBackingStore for MemoryBackingStore
§fn set_block_hash(&mut self, bhh: StacksBlockId) -> Result<StacksBlockId, Error>
fn set_block_hash(&mut self, bhh: StacksBlockId) -> Result<StacksBlockId, Error>
change the current MARF context to service reads from a different chain_tip
used to implement time-shifted evaluation.
returns the previous block header hash on success
§fn get_with_proof(&mut self, key: &str) -> Option<(String, Vec<u8>)>
fn get_with_proof(&mut self, key: &str) -> Option<(String, Vec<u8>)>
fetch K-V out of the committed datastore, along with the byte representation
of the Merkle proof for that key-value pair
fn get_side_store(&mut self) -> &Connection
§fn get_block_at_height(&mut self, height: u32) -> Option<StacksBlockId>
fn get_block_at_height(&mut self, height: u32) -> Option<StacksBlockId>
Is None if
block_height
>= the “currently” under construction Stacks block height.fn get_open_chain_tip(&mut self) -> StacksBlockId
fn get_open_chain_tip_height(&mut self) -> u32
§fn get_current_block_height(&mut self) -> u32
fn get_current_block_height(&mut self) -> u32
this function returns the current block height, as viewed by this marfed-kv structure,
i.e., it changes on time-shifted evaluation. the open_chain_tip functions always
return data about the chain tip that is currently open for writing.
fn get_cc_special_cases_handler( &self ) -> Option<&'static dyn Fn(&mut GlobalContext<'_, '_>, Option<&PrincipalData>, Option<&PrincipalData>, &QualifiedContractIdentifier, &str, &[Value], &Value) -> Result<(), Error>>
§fn get_contract_hash(
&mut self,
contract: &QualifiedContractIdentifier
) -> Result<(StacksBlockId, Sha512Trunc256Sum), Error>
fn get_contract_hash( &mut self, contract: &QualifiedContractIdentifier ) -> Result<(StacksBlockId, Sha512Trunc256Sum), Error>
This function is used to obtain a committed contract hash, and the block header hash of the block
in which the contract was initialized. This data is used to store contract metadata in the side
store.
fn insert_metadata( &mut self, contract: &QualifiedContractIdentifier, key: &str, value: &str )
fn get_metadata( &mut self, contract: &QualifiedContractIdentifier, key: &str ) -> Result<Option<String>, Error>
fn get_metadata_manual( &mut self, at_height: u32, contract: &QualifiedContractIdentifier, key: &str ) -> Result<Option<String>, Error>
fn has_entry(&mut self, key: &str) -> bool
§fn make_contract_commitment(
&mut self,
contract_hash: Sha512Trunc256Sum
) -> String
fn make_contract_commitment( &mut self, contract_hash: Sha512Trunc256Sum ) -> String
The contract commitment is the hash of the contract, plus the block height in
which the contract was initialized.
fn put_all_metadata( &mut self, items: Vec<((QualifiedContractIdentifier, String), String)> )
Auto Trait Implementations§
impl !RefUnwindSafe for MemoryBackingStore
impl Send for MemoryBackingStore
impl !Sync for MemoryBackingStore
impl Unpin for MemoryBackingStore
impl !UnwindSafe for MemoryBackingStore
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
Mutably borrows from an owned value. Read more