Trait sc_executor_common::util::MemoryTransfer
source · pub trait MemoryTransfer {
// Required methods
fn read(&self, source_addr: Pointer<u8>, size: usize) -> Result<Vec<u8>>;
fn read_into(
&self,
source_addr: Pointer<u8>,
destination: &mut [u8],
) -> Result<()>;
fn write_from(&self, dest_addr: Pointer<u8>, source: &[u8]) -> Result<()>;
}
Expand description
Provides safe memory access interface using an external buffer
Required Methods§
sourcefn read(&self, source_addr: Pointer<u8>, size: usize) -> Result<Vec<u8>>
fn read(&self, source_addr: Pointer<u8>, size: usize) -> Result<Vec<u8>>
Read data from a slice of memory into a newly allocated buffer.
Returns an error if the read would go out of the memory bounds.