fn read_sandbox_memory(
		&mut self,
		ptr: u32,
		len: u32,
	) -> Result<Vec<u8>, sp_sandbox::HostError> {
		self.charge_gas(
			RuntimeToken::ReadMemory(len),
		)?;

		let mut buf = vec![0u8; len as usize];
		self.memory.get(ptr, buf.as_mut_slice()).map_err(|_| sp_sandbox::HostError)?;
		Ok(buf)
	}
/// Read designated chunk from the sandbox memory, consuming an appropriate amount of
/// gas.
///
/// Returns `Err` if one of the following conditions occurs:
///
/// - calculating the gas cost resulted in overflow.
/// - out of gas
/// - requested buffer is not within the bounds of the sandbox memory.
Read designated chunk from the sandbox memory, consuming an appropriate amount of
gas.

Returns `Err` if one of the following conditions occurs.

calculating the gas cost resulted in overflow.
out of gas
requested buffer is not within the bounds of the sandbox memory.
Read designated chunk from the sandbox memory consuming an appropriate amount of gas . Returns ` Err ` if one of the following conditions occurs . calculating the gas cost resulted in overflow . out of gas requested buffer is not within the bounds of the sandbox memory .
fn read_sandbox_memory(
		&mut self,
		ptr: u32,
		len: u32,
	) -> Result<Vec<u8>, sp_sandbox::HostError> {
		self.charge_gas(
			RuntimeToken::ReadMemory(len),
		)?;
		let mut buf = vec![0u8; len as usize];
		self.memory.get(ptr, buf.as_mut_slice()).map_err(|_| sp_sandbox::HostError)?;
		Ok(buf)
	}
fn read_sandbox_memory ( & mut self , ptr : u32 , len : u32 , ) -> Result < Vec < u8 > , sp_sandbox :: HostError > { self . charge_gas ( RuntimeToken :: ReadMemory ( len ) , ) ? ; let mut buf = vec ! [ 0u8 len as usize ] ; self . memory . get ( ptr , buf . as_mut_slice ( ) ) . map_err ( | _ | sp_sandbox :: HostError ) ? ; Ok ( buf ) }
Read designated chunk from the sandbox memory, consuming an appropriate amount of
gas.
Read designated chunk from the sandbox memory consuming an appropriate amount of gas .
&mut self
ptr
u32
len
u32
&mut self
ptr
u32
len
u32