Trait multiversx_sc_scenario::api::VMHooksApiBackend
source · pub trait VMHooksApiBackend: Clone + Send + Sync + 'static {
type HandleType: HandleConstraints;
// Required methods
fn with_vm_hooks<R, F>(f: F) -> R
where F: FnOnce(&dyn VMHooks) -> R;
fn with_static_data<R, F>(f: F) -> R
where F: FnOnce(&StaticVarData) -> R;
// Provided methods
fn with_vm_hooks_ctx_1<R, F>(_handle: Self::HandleType, f: F) -> R
where F: FnOnce(&dyn VMHooks) -> R { ... }
fn with_vm_hooks_ctx_2<R, F>(
_handle1: Self::HandleType,
_handle2: Self::HandleType,
f: F,
) -> R
where F: FnOnce(&dyn VMHooks) -> R { ... }
fn with_vm_hooks_ctx_3<R, F>(
_handle1: Self::HandleType,
_handle2: Self::HandleType,
_handle3: Self::HandleType,
f: F,
) -> R
where F: FnOnce(&dyn VMHooks) -> R { ... }
fn assert_live_handle(_handle: &Self::HandleType) { ... }
}
Required Associated Types§
sourcetype HandleType: HandleConstraints
type HandleType: HandleConstraints
We use a single handle type for all handles.
Required Methods§
sourcefn with_vm_hooks<R, F>(f: F) -> R
fn with_vm_hooks<R, F>(f: F) -> R
All communication with the VM happens via this method.
sourcefn with_static_data<R, F>(f: F) -> Rwhere
F: FnOnce(&StaticVarData) -> R,
fn with_static_data<R, F>(f: F) -> Rwhere
F: FnOnce(&StaticVarData) -> R,
Static data does not belong to the VM, or to the VM hooks. It belongs to the contract only.
Provided Methods§
fn with_vm_hooks_ctx_1<R, F>(_handle: Self::HandleType, f: F) -> R
fn with_vm_hooks_ctx_2<R, F>( _handle1: Self::HandleType, _handle2: Self::HandleType, f: F, ) -> R
fn with_vm_hooks_ctx_3<R, F>( _handle1: Self::HandleType, _handle2: Self::HandleType, _handle3: Self::HandleType, f: F, ) -> R
fn assert_live_handle(_handle: &Self::HandleType)
Object Safety§
This trait is not object safe.