Struct stacks_rpc_client::clarity::vm::contexts::OwnedEnvironment
pub struct OwnedEnvironment<'a, 'hooks> { /* private fields */ }
Implementations§
§impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks>
impl<'a, 'hooks> OwnedEnvironment<'a, 'hooks>
pub fn new_free( mainnet: bool, chain_id: u32, database: ClarityDatabase<'a>, epoch_id: StacksEpochId ) -> OwnedEnvironment<'a, 'a>
pub fn new_cost_limited( mainnet: bool, chain_id: u32, database: ClarityDatabase<'a>, cost_tracker: LimitedCostTracker, epoch_id: StacksEpochId ) -> OwnedEnvironment<'a, 'a>
pub fn get_exec_environment<'b>( &'b mut self, sender: Option<PrincipalData>, sponsor: Option<PrincipalData>, context: &'b mut ContractContext ) -> Environment<'b, 'a, 'hooks>
pub fn execute_in_env<F, A, E>( &mut self, sender: PrincipalData, sponsor: Option<PrincipalData>, initial_context: Option<ContractContext>, f: F ) -> Result<(A, AssetMap, Vec<StacksTransactionEvent>), E>where E: From<Error>, F: FnOnce(&mut Environment<'_, '_, '_>) -> Result<A, E>,
pub fn initialize_versioned_contract( &mut self, contract_identifier: QualifiedContractIdentifier, version: ClarityVersion, contract_content: &str, sponsor: Option<PrincipalData>, ast_rules: ASTRules ) -> Result<((), AssetMap, Vec<StacksTransactionEvent>), Error>
pub fn initialize_contract_from_ast( &mut self, contract_identifier: QualifiedContractIdentifier, clarity_version: ClarityVersion, contract_content: &ContractAST, contract_string: &str, sponsor: Option<PrincipalData> ) -> Result<((), AssetMap, Vec<StacksTransactionEvent>), Error>
pub fn execute_transaction( &mut self, sender: PrincipalData, sponsor: Option<PrincipalData>, contract_identifier: QualifiedContractIdentifier, tx_name: &str, args: &[SymbolicExpression] ) -> Result<(Value, AssetMap, Vec<StacksTransactionEvent>), Error>
pub fn stx_transfer( &mut self, from: &PrincipalData, to: &PrincipalData, amount: u128, memo: &BuffData ) -> Result<(Value, AssetMap, Vec<StacksTransactionEvent>), Error>
pub fn eval_read_only_with_rules( &mut self, contract: &QualifiedContractIdentifier, program: &str, ast_rules: ASTRules ) -> Result<(Value, AssetMap, Vec<StacksTransactionEvent>), Error>
pub fn begin(&mut self)
pub fn commit(&mut self) -> Result<(AssetMap, EventBatch), Error>
pub fn get_cost_total(&self) -> ExecutionCost
pub fn destruct(self) -> Option<(ClarityDatabase<'a>, LimitedCostTracker)>
pub fn destruct(self) -> Option<(ClarityDatabase<'a>, LimitedCostTracker)>
Destroys this environment, returning ownership of its database reference. If the context wasn’t top-level (i.e., it had uncommitted data), return None, because the database is not guaranteed to be in a sane state.
pub fn add_eval_hook(&mut self, hook: &'hooks mut dyn EvalHook)
Auto Trait Implementations§
impl<'a, 'hooks> !RefUnwindSafe for OwnedEnvironment<'a, 'hooks>
impl<'a, 'hooks> !Send for OwnedEnvironment<'a, 'hooks>
impl<'a, 'hooks> !Sync for OwnedEnvironment<'a, 'hooks>
impl<'a, 'hooks> Unpin for OwnedEnvironment<'a, 'hooks>
impl<'a, 'hooks> !UnwindSafe for OwnedEnvironment<'a, 'hooks>
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