pub struct TxContext {
pub vm_ref: BlockchainVMRef,
pub tx_input_box: Box<TxInput>,
pub tx_cache: Arc<TxCache>,
pub managed_types: Mutex<TxManagedTypes>,
pub back_transfers: Mutex<BackTransfers>,
pub tx_result_cell: Mutex<TxResult>,
pub b_rng: Mutex<BlockchainRng>,
}
Fields§
§vm_ref: BlockchainVMRef
§tx_input_box: Box<TxInput>
§tx_cache: Arc<TxCache>
§managed_types: Mutex<TxManagedTypes>
§back_transfers: Mutex<BackTransfers>
§tx_result_cell: Mutex<TxResult>
§b_rng: Mutex<BlockchainRng>
Implementations§
Source§impl TxContext
impl TxContext
pub fn new( vm_ref: BlockchainVMRef, tx_input: TxInput, tx_cache: TxCache, ) -> Self
pub fn dummy() -> Self
pub fn input_ref(&self) -> &TxInput
pub fn blockchain_cache(&self) -> &TxCache
pub fn blockchain_cache_arc(&self) -> Arc<TxCache>
pub fn blockchain_ref(&self) -> &BlockchainState
pub fn with_account<R, F>(&self, address: &VMAddress, f: F) -> Rwhere
F: FnOnce(&AccountData) -> R,
pub fn with_account_or_else<R, F, Else>( &self, address: &VMAddress, f: F, or_else: Else, ) -> R
pub fn with_contract_account<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&AccountData) -> R,
pub fn with_account_mut<R, F>(&self, address: &VMAddress, f: F) -> Rwhere
F: FnOnce(&mut AccountData) -> R,
pub fn with_contract_account_mut<R, F>(&self, f: F) -> Rwhere
F: FnOnce(&mut AccountData) -> R,
pub fn m_types_lock(&self) -> MutexGuard<'_, TxManagedTypes>
pub fn back_transfers_lock(&self) -> MutexGuard<'_, BackTransfers>
pub fn result_lock(&self) -> MutexGuard<'_, TxResult>
pub fn extract_result(&self) -> TxResult
pub fn rng_lock(&self) -> MutexGuard<'_, BlockchainRng>
pub fn create_new_contract( &self, new_address: &VMAddress, contract_path: Vec<u8>, code_metadata: VMCodeMetadata, contract_owner: VMAddress, )
pub fn into_blockchain_updates(self) -> BlockchainUpdate
pub fn into_results(self) -> (TxResult, BlockchainUpdate)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for TxContext
impl !RefUnwindSafe for TxContext
impl Send for TxContext
impl Sync for TxContext
impl Unpin for TxContext
impl !UnwindSafe for TxContext
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more