[][src]Function fluence_sdk_main::memory::read_input_from_mem

pub unsafe fn read_input_from_mem(ptr: *mut u8, len: usize) -> Vec<u8>

Reads array of bytes from a given ptr that has to have len bytes size.

Safety

The ownership of ptr is effectively (without additional allocation) transferred to the resulted Vec which can be then safely deallocated, reallocated or so on. There have to the only one instance of Vec constructed from one such pointer since there aren't any memory copying.