fn write_sandbox_memory(
		&mut self,
		ptr: u32,
		buf: &[u8],
	) -> Result<(), sp_sandbox::HostError> {
		self.charge_gas(
			RuntimeToken::WriteMemory(buf.len() as u32),
		)?;

		self.memory.set(ptr, buf)?;

		Ok(())
	}
/// Write the given buffer to the designated location in 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
/// - designated area is not within the bounds of the sandbox memory.
Write the given buffer to the designated location in 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
designated area is not within the bounds of the sandbox memory.
Write the given buffer to the designated location in 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 designated area is not within the bounds of the sandbox memory .
fn write_sandbox_memory(
		&mut self,
		ptr: u32,
		buf: &[u8],
	) -> Result<(), sp_sandbox::HostError> {
		self.charge_gas(
			RuntimeToken::WriteMemory(buf.len() as u32),
		)?;
		self.memory.set(ptr, buf)?;
		Ok(())
	}
fn write_sandbox_memory ( & mut self , ptr : u32 , buf : & [ u8 ] , ) -> Result < ( ) , sp_sandbox :: HostError > { self . charge_gas ( RuntimeToken :: WriteMemory ( buf . len ( ) as u32 ) , ) ? ; self . memory . set ( ptr , buf ) ? ; Ok ( ( ) ) }
Write the given buffer to the designated location in the sandbox memory, consuming
an appropriate amount of gas.
Write the given buffer to the designated location in the sandbox memory consuming an appropriate amount of gas .
&mut self
ptr
u32
buf
&[u8]
&mut self
ptr
u32
buf
&[u8]