[][src]Struct clarity_repl::clarity::database::datastore::Datastore

pub struct Datastore { /* fields omitted */ }

Implementations

impl Datastore[src]

pub fn new() -> Datastore[src]

impl Datastore[src]

pub fn open(
    path_str: &str,
    miner_tip: Option<&StacksBlockId>
) -> Result<Datastore>
[src]

pub fn as_clarity_db<'a>(
    &'a mut self,
    headers_db: &'a dyn HeadersDB
) -> ClarityDatabase<'a>
[src]

pub fn as_analysis_db<'a>(&'a mut self) -> AnalysisDatabase<'a>[src]

pub fn begin(&mut self, current: &StacksBlockId, next: &StacksBlockId)[src]

begin, commit, rollback a save point identified by key this is used to clean up any data from aborted blocks (NOT aborted transactions that is handled by the clarity vm directly). The block header hash is used for identifying savepoints. this cannot be used to rollback to arbitrary prior block hash, because that blockhash would already have committed and no longer exist in the save point stack. this is a "lower-level" rollback than the roll backs performed in ClarityDatabase or AnalysisDatabase -- this is done at the backing store level.

pub fn rollback(&mut self)[src]

pub fn commit_mined_block(&mut self, will_move_to: &StacksBlockId)[src]

pub fn commit_to(&mut self, final_bhh: &StacksBlockId)[src]

pub fn get_chain_tip(&self) -> &StacksBlockId[src]

pub fn set_chain_tip(&mut self, bhh: &StacksBlockId)[src]

pub fn put(&mut self, key: &str, value: &str)[src]

pub fn make_contract_hash_key(contract: &QualifiedContractIdentifier) -> String[src]

Trait Implementations

impl ClarityBackingStore for Datastore[src]

fn get(&mut self, key: &str) -> Option<String>[src]

fetch K-V out of the committed datastore

fn set_block_hash(&mut self, bhh: StacksBlockId) -> Result<StacksBlockId>[src]

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_current_block_height(&mut self) -> u32[src]

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 make_contract_commitment(
    &mut self,
    contract_hash: Sha512Trunc256Sum
) -> String
[src]

The contract commitment is the hash of the contract, plus the block height in which the contract was initialized.

impl Clone for Datastore[src]

impl Debug for Datastore[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.