[−][src]Function fluence::sdk::memory::write_result_to_mem
pub unsafe fn write_result_to_mem(
result: &[u8]
) -> Result<NonNull<u8>, MemError>
Allocates 'RESULT_SIZE_BYTES + result.len()' bytes and writes length of the result as little
endianes RESULT_SIZE_BYTES bytes and then writes content of 'result'. So the final layout of
the result in memory is following:
| array_length: RESULT_SIZE_BYTES bytes (little-endian) | array: $array_length bytes |
This function should normally be used for returning result of invoke
function. Vm wrapper
expects result in this format.