Struct clarity_repl::clarity::contexts::Environment[][src]

pub struct Environment<'a, 'b> {
    pub global_context: &'a mut GlobalContext<'b>,
    pub contract_context: &'a ContractContext,
    pub call_stack: &'a mut CallStack,
    pub sender: Option<Value>,
    pub caller: Option<Value>,
}

Fields

global_context: &'a mut GlobalContext<'b>contract_context: &'a ContractContextcall_stack: &'a mut CallStacksender: Option<Value>caller: Option<Value>

Implementations

impl<'a, 'b> Environment<'a, 'b>[src]

pub fn new(
    global_context: &'a mut GlobalContext<'b>,
    contract_context: &'a ContractContext,
    call_stack: &'a mut CallStack,
    sender: Option<Value>,
    caller: Option<Value>
) -> Environment<'a, 'b>
[src]

pub fn nest_as_principal<'c>(&'c mut self, sender: Value) -> Environment<'c, 'b>[src]

pub fn nest_with_caller<'c>(&'c mut self, caller: Value) -> Environment<'c, 'b>[src]

pub fn eval_read_only(
    &mut self,
    contract_identifier: &QualifiedContractIdentifier,
    program: &str
) -> Result<Value>
[src]

pub fn eval_raw(&mut self, program: &str) -> Result<Value>[src]

pub fn run_free<F, A>(&mut self, to_run: F) -> A where
    F: FnOnce(&mut Environment<'_, '_>) -> A, 
[src]

Used only for contract-call! cost short-circuiting. Once the short-circuited cost has been evaluated and assessed, the contract-call! itself is executed “for free”.

pub fn execute_contract(
    &mut self,
    contract_identifier: &QualifiedContractIdentifier,
    tx_name: &str,
    args: &[SymbolicExpression],
    read_only: bool
) -> Result<Value>
[src]

pub fn execute_function_as_transaction(
    &mut self,
    function: &DefinedFunction,
    args: &[Value],
    next_contract_context: Option<&ContractContext>
) -> Result<Value>
[src]

pub fn evaluate_at_block(
    &mut self,
    bhh: StacksBlockId,
    closure: &SymbolicExpression,
    local: &LocalContext<'_>
) -> Result<Value>
[src]

pub fn initialize_contract(
    &mut self,
    contract_identifier: QualifiedContractIdentifier,
    contract_content: &str
) -> Result<()>
[src]

pub fn initialize_contract_from_ast(
    &mut self,
    contract_identifier: QualifiedContractIdentifier,
    contract_content: &ContractAST,
    contract_string: &str
) -> Result<()>
[src]

pub fn stx_transfer(
    &mut self,
    from: &PrincipalData,
    to: &PrincipalData,
    amount: u128
) -> Result<Value>
[src]

Top-level STX-transfer, invoked by TokenTransfer transactions. Only commits if the inner stx_transfer_consolidated() returns an (ok true) value. Rolls back if it returns an (err ..) value, or if the method itself fails for some reason (miners should never build blocks that spend non-existent STX in a top-level token-transfer)

pub fn register_print_event(&mut self, value: Value) -> Result<()>[src]

pub fn register_stx_transfer_event(
    &mut self,
    sender: PrincipalData,
    recipient: PrincipalData,
    amount: u128
) -> Result<()>
[src]

pub fn register_stx_burn_event(
    &mut self,
    sender: PrincipalData,
    amount: u128
) -> Result<()>
[src]

pub fn register_nft_transfer_event(
    &mut self,
    sender: PrincipalData,
    recipient: PrincipalData,
    value: Value,
    asset_identifier: AssetIdentifier
) -> Result<()>
[src]

pub fn register_nft_mint_event(
    &mut self,
    recipient: PrincipalData,
    value: Value,
    asset_identifier: AssetIdentifier
) -> Result<()>
[src]

pub fn register_nft_burn_event(
    &mut self,
    sender: PrincipalData,
    value: Value,
    asset_identifier: AssetIdentifier
) -> Result<()>
[src]

pub fn register_ft_transfer_event(
    &mut self,
    sender: PrincipalData,
    recipient: PrincipalData,
    amount: u128,
    asset_identifier: AssetIdentifier
) -> Result<()>
[src]

pub fn register_ft_mint_event(
    &mut self,
    recipient: PrincipalData,
    amount: u128,
    asset_identifier: AssetIdentifier
) -> Result<()>
[src]

pub fn register_ft_burn_event(
    &mut self,
    sender: PrincipalData,
    amount: u128,
    asset_identifier: AssetIdentifier
) -> Result<()>
[src]

Trait Implementations

impl CostTracker for Environment<'_, '_>[src]

Auto Trait Implementations

impl<'a, 'b> !RefUnwindSafe for Environment<'a, 'b>

impl<'a, 'b> !Send for Environment<'a, 'b>

impl<'a, 'b> !Sync for Environment<'a, 'b>

impl<'a, 'b> Unpin for Environment<'a, 'b> where
    'b: 'a, 

impl<'a, 'b> !UnwindSafe for Environment<'a, 'b>

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, 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.

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