Function hdk::prelude::host_args[][src]

pub fn host_args<O>(ptr: u32) -> Result<O, u32> where
    O: DeserializeOwned + Debug

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.