pub unsafe fn coerce_host_index_to_func<T>(idx: HostFuncIndex) -> HostFuncType<T> {
		// We need to ensure that sizes of a callable function pointer and host function index is
		// indeed equal.
		// We can't use `static_assertions` create because it makes compiler panic, fallback to runtime assert.
		// const_assert!(mem::size_of::<HostFuncIndex>() == mem::size_of::<HostFuncType<T>>(),);
		assert!(mem::size_of::<HostFuncIndex>() == mem::size_of::<HostFuncType<T>>());
		mem::transmute::<HostFuncIndex, HostFuncType<T>>(idx)
	}
/// Coerce `HostFuncIndex` to a callable host function pointer.
///
/// # Safety
///
/// This function should be only called with a `HostFuncIndex` that was previously registered
/// in the environment defintion. Typically this should only
/// be called with an argument received in `dispatch_thunk`.
Coerce `HostFuncIndex` to a callable host function pointer.
Coerce ` HostFuncIndex ` to a callable host function pointer .
pub unsafe fn coerce_host_index_to_func<T>(idx: HostFuncIndex) -> HostFuncType<T> {
		// We need to ensure that sizes of a callable function pointer and host function index is
		// indeed equal.
		// We can't use `static_assertions` create because it makes compiler panic, fallback to runtime assert.
		// const_assert!(mem::size_of::<HostFuncIndex>() == mem::size_of::<HostFuncType<T>>(),);
		assert!(mem::size_of::<HostFuncIndex>() == mem::size_of::<HostFuncType<T>>());
		mem::transmute::<HostFuncIndex, HostFuncType<T>>(idx)
	}
pub unsafe fn coerce_host_index_to_func < T > ( idx : HostFuncIndex ) -> HostFuncType < T > { // We need to ensure that sizes of a callable function pointer and host function index is // indeed equal. // We can't use `static_assertions` create because it makes compiler panic, fallback to runtime assert. // const_assert!(mem::size_of::<HostFuncIndex>() == mem::size_of::<HostFuncType<T>>(),); assert ! ( mem size_of HostFuncIndex ( ) mem size_of HostFuncType T ( ) ) ; mem :: transmute :: < HostFuncIndex , HostFuncType < T > > ( idx ) }
Coerce `HostFuncIndex` to a callable host function pointer.
Coerce ` HostFuncIndex ` to a callable host function pointer .
idx
HostFuncIndex
idx
HostFuncIndex
safety
This function should be only called with a `HostFuncIndex` that was previously registered
in the environment defintion. Typically this should only
be called with an argument received in `dispatch_thunk`.
This function should be only called with a ` HostFuncIndex ` that was previously registered in the environment defintion . Typically this should only be called with an argument received in ` dispatch_thunk ` .