Struct clarity_repl::clarity::contexts::OwnedEnvironment
source · [−]pub struct OwnedEnvironment<'a> { /* private fields */ }
Implementations
sourceimpl<'a> OwnedEnvironment<'a>
impl<'a> OwnedEnvironment<'a>
pub fn new(database: ClarityDatabase<'a>) -> OwnedEnvironment<'a>
pub fn new_free(
mainnet: bool,
database: ClarityDatabase<'a>
) -> OwnedEnvironment<'a>
pub fn new_cost_limited(
mainnet: bool,
database: ClarityDatabase<'a>,
cost_tracker: LimitedCostTracker
) -> OwnedEnvironment<'a>
pub fn get_exec_environment<'b>(
&'b mut self,
sender: Option<PrincipalData>
) -> Environment<'b, 'a>
pub fn execute_in_env<F, A, E>(
&mut self,
sender: PrincipalData,
f: F
) -> Result<(A, AssetMap, Vec<StacksTransactionEvent>), E> where
E: From<Error>,
F: FnOnce(&mut Environment<'_, '_>) -> Result<A, E>,
pub fn initialize_contract(
&mut self,
contract_identifier: QualifiedContractIdentifier,
contract_content: &str
) -> Result<((), AssetMap, Vec<StacksTransactionEvent>)>
pub fn initialize_contract_from_ast(
&mut self,
contract_identifier: QualifiedContractIdentifier,
contract_content: &ContractAST,
contract_string: &str
) -> Result<((), AssetMap, Vec<StacksTransactionEvent>)>
pub fn execute_transaction(
&mut self,
sender: PrincipalData,
contract_identifier: QualifiedContractIdentifier,
tx_name: &str,
args: &[SymbolicExpression]
) -> Result<(Value, AssetMap, Vec<StacksTransactionEvent>)>
pub fn stx_transfer(
&mut self,
from: &PrincipalData,
to: &PrincipalData,
amount: u128
) -> Result<(Value, AssetMap, Vec<StacksTransactionEvent>)>
pub fn eval_read_only(
&mut self,
contract: &QualifiedContractIdentifier,
program: &str
) -> Result<(Value, AssetMap, Vec<StacksTransactionEvent>)>
pub fn begin(&mut self)
pub fn commit(&mut self) -> Result<(AssetMap, EventBatch)>
pub fn get_cost_total(&self) -> ExecutionCost
sourcepub 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.
Auto Trait Implementations
impl<'a> !RefUnwindSafe for OwnedEnvironment<'a>
impl<'a> !Send for OwnedEnvironment<'a>
impl<'a> !Sync for OwnedEnvironment<'a>
impl<'a> Unpin for OwnedEnvironment<'a>
impl<'a> !UnwindSafe for OwnedEnvironment<'a>
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>
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