pub struct Datastore { /* private fields */ }
Implementations
sourceimpl Datastore
impl Datastore
pub fn open(
path_str: &str,
miner_tip: Option<&StacksBlockId>
) -> Result<Datastore>
pub fn as_clarity_db<'a>(
&'a mut self,
headers_db: &'a dyn HeadersDB
) -> ClarityDatabase<'a>
pub fn as_analysis_db<'a>(&'a mut self) -> AnalysisDatabase<'a>
sourcepub fn begin(&mut self, current: &StacksBlockId, next: &StacksBlockId)
pub fn begin(&mut self, current: &StacksBlockId, next: &StacksBlockId)
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)
pub fn commit_mined_block(&mut self, will_move_to: &StacksBlockId)
pub fn commit_to(&mut self, final_bhh: &StacksBlockId)
pub fn get_chain_tip(&self) -> &StacksBlockId
pub fn set_chain_tip(&mut self, bhh: &StacksBlockId)
pub fn put(&mut self, key: &str, value: &str)
pub fn make_contract_hash_key(contract: &QualifiedContractIdentifier) -> String
Trait Implementations
sourceimpl ClarityBackingStore for Datastore
impl ClarityBackingStore for Datastore
sourcefn set_block_hash(&mut self, bhh: StacksBlockId) -> Result<StacksBlockId>
fn set_block_hash(&mut self, bhh: StacksBlockId) -> Result<StacksBlockId>
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
sourcefn 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.
sourcefn 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 has_entry(&mut self, key: &str) -> bool
fn get_block_at_height(&mut self, height: u32) -> Option<StacksBlockId>
fn get_open_chain_tip_height(&mut self) -> u32
fn get_open_chain_tip(&mut self) -> StacksBlockId
sourcefn insert_metadata(
&mut self,
contract: &QualifiedContractIdentifier,
key: &str,
value: &str
)
fn insert_metadata(
&mut self,
contract: &QualifiedContractIdentifier,
key: &str,
value: &str
)
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. Read more
fn get_metadata(
&mut self,
contract: &QualifiedContractIdentifier,
key: &str
) -> Result<Option<String>>
Auto Trait Implementations
impl RefUnwindSafe for Datastore
impl Send for Datastore
impl Sync for Datastore
impl Unpin for Datastore
impl UnwindSafe for Datastore
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more