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

		self.scratch_buf.resize(len as usize, 0);
		self.memory.get(ptr, self.scratch_buf.as_mut_slice()).map_err(|_| sp_sandbox::HostError)?;
		Ok(())
	}
/// Read designated chunk from the sandbox memory into the scratch buffer, consuming an
/// appropriate amount of gas. Resizes the scratch buffer to the specified length on success.
///
/// 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 into the scratch buffer, consuming an
appropriate amount of gas. Resizes the scratch buffer to the specified length on success.

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 into the scratch buffer consuming an appropriate amount of gas . Resizes the scratch buffer to the specified length on success . 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_into_scratch(
		&mut self,
		ptr: u32,
		len: u32,
	) -> Result<(), sp_sandbox::HostError> {
		self.charge_gas(
			RuntimeToken::ReadMemory(len),
		)?;
		self.scratch_buf.resize(len as usize, 0);
		self.memory.get(ptr, self.scratch_buf.as_mut_slice()).map_err(|_| sp_sandbox::HostError)?;
		Ok(())
	}
fn read_sandbox_memory_into_scratch ( & mut self , ptr : u32 , len : u32 , ) -> Result < ( ) , sp_sandbox :: HostError > { self . charge_gas ( RuntimeToken :: ReadMemory ( len ) , ) ? ; self . scratch_buf . resize ( len as usize , 0 ) ; self . memory . get ( ptr , self . scratch_buf . as_mut_slice ( ) ) . map_err ( | _ | sp_sandbox :: HostError ) ? ; Ok ( ( ) ) }
Read designated chunk from the sandbox memory into the scratch buffer, consuming an
appropriate amount of gas.
Read designated chunk from the sandbox memory into the scratch buffer consuming an appropriate amount of gas .
&mut self
ptr
u32
len
u32
&mut self
ptr
u32
len
u32