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)
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.