[−][src]Function casperlabs_contract::ext_ffi::read_value
pub unsafe extern "C" fn read_value(
key_ptr: *const u8,
key_size: usize,
output_size: *mut usize
) -> i32
The bytes in the span of wasm memory from key_ptr
to key_ptr + key_size
must correspond
to a valid global state key, otherwise the function will fail. If the key is de-serialized
successfully, then the result of the read is serialized and buffered in the runtime. This
result can be obtained via the read_host_buffer
function. Returns standard error code.
Arguments
key_ptr
- pointer (offset in wasm linear memory) to serialized form of the key to readkey_size
- size of the serialized key (in bytes)output_size
- pointer to a value where host will write size of bytes read from given key