pub struct OwnedEnvironment<'a, 'hooks> { /* private fields */ }

Implementations§

§

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)>

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more