read_bytes

Function read_bytes 

Source
pub unsafe fn read_bytes(ptr: StablePtr, buf: &mut [u8])
Expand description

Reads raw bytes from stable memory.

Under the hood simply calls stable64_read.

§Safety

Make sure you’re reading from a valid memory block. All kinds of bad things can happen. Also, this function does not handle stable memory ownership in any way, so you have to make sure your data won’t get stable-dropped manually. See crate::SBox for an example of how this can be done.