Function hdk::prelude::host_args

source ·
pub fn host_args<O>(ptr: usize, len: usize) -> Result<O, u128>
Expand description

Receive arguments from the host. The guest sets the type O that the host needs to match. If deserialization fails then a GuestPtr to a WasmError::Deserialize is returned. The guest should immediately return an Err back to the host. The WasmError::Deserialize enum contains the bytes that failed to deserialize so the host can unambiguously provide debug information.