fn load_call_stack(
        &mut self,
        // (Output) Pointer to number of elements in the call stack.
        call_stack_len_ptr: u32,
        // (Output) Pointer to size in bytes of the serialized call stack.
        result_size_ptr: u32,
    ) -> Result<Result<(), ApiError>, Trap> {
        if !self.can_write_to_host_buffer() {
            // Exit early if the host buffer is already occupied
            return Ok(Err(ApiError::HostBufferFull));
        }
        let call_stack = self.stack.call_stack_elements();
        let call_stack_len = call_stack.len() as u32;
        let call_stack_len_bytes = call_stack_len.to_le_bytes();

        if let Err(error) = self.memory.set(call_stack_len_ptr, &call_stack_len_bytes) {
            return Err(Error::Interpreter(error.into()).into());
        }

        if call_stack_len == 0 {
            return Ok(Ok(()));
        }

        let call_stack_cl_value = CLValue::from_t(call_stack.clone()).map_err(Error::CLValue)?;

        let call_stack_cl_value_bytes_len = call_stack_cl_value.inner_bytes().len() as u32;
        if let Err(error) = self.write_host_buffer(call_stack_cl_value) {
            return Ok(Err(error));
        }

        let call_stack_cl_value_bytes_len_bytes = call_stack_cl_value_bytes_len.to_le_bytes();

        if let Err(error) = self
            .memory
            .set(result_size_ptr, &call_stack_cl_value_bytes_len_bytes)
        {
            return Err(Error::Interpreter(error.into()).into());
        }

        Ok(Ok(()))
    }
/// Load the uref known by the given name into the Wasm memory
Load the uref known by the given name into the Wasm memory
Load the uref known by the given name into the Wasm memory
fn load_call_stack(
        &mut self,
        // (Output) Pointer to number of elements in the call stack.
        call_stack_len_ptr: u32,
        // (Output) Pointer to size in bytes of the serialized call stack.
        result_size_ptr: u32,
    ) -> Result<Result<(), ApiError>, Trap> {
        if !self.can_write_to_host_buffer() {
            // Exit early if the host buffer is already occupied
            return Ok(Err(ApiError::HostBufferFull));
        }
        let call_stack = self.stack.call_stack_elements();
        let call_stack_len = call_stack.len() as u32;
        let call_stack_len_bytes = call_stack_len.to_le_bytes();
        if let Err(error) = self.memory.set(call_stack_len_ptr, &call_stack_len_bytes) {
            return Err(Error::Interpreter(error.into()).into());
        }
        if call_stack_len == 0 {
            return Ok(Ok(()));
        }
        let call_stack_cl_value = CLValue::from_t(call_stack.clone()).map_err(Error::CLValue)?;
        let call_stack_cl_value_bytes_len = call_stack_cl_value.inner_bytes().len() as u32;
        if let Err(error) = self.write_host_buffer(call_stack_cl_value) {
            return Ok(Err(error));
        }
        let call_stack_cl_value_bytes_len_bytes = call_stack_cl_value_bytes_len.to_le_bytes();
        if let Err(error) = self
            .memory
            .set(result_size_ptr, &call_stack_cl_value_bytes_len_bytes)
        {
            return Err(Error::Interpreter(error.into()).into());
        }
        Ok(Ok(()))
    }
fn load_call_stack ( & mut self , // (Output) Pointer to number of elements in the call stack. call_stack_len_ptr : u32 , // (Output) Pointer to size in bytes of the serialized call stack. result_size_ptr : u32 , ) -> Result < Result < ( ) , ApiError > , Trap > { if ! self . can_write_to_host_buffer ( ) { // Exit early if the host buffer is already occupied return Ok ( Err ( ApiError :: HostBufferFull ) ) ; } let call_stack = self . stack . call_stack_elements ( ) ; let call_stack_len = call_stack . len ( ) as u32 ; let call_stack_len_bytes = call_stack_len . to_le_bytes ( ) ; if let Err ( error ) = self . memory . set ( call_stack_len_ptr , & call_stack_len_bytes ) { return Err ( Error :: Interpreter ( error . into ( ) ) . into ( ) ) ; } if call_stack_len == 0 { return Ok ( Ok ( ( ) ) ) ; } let call_stack_cl_value = CLValue :: from_t ( call_stack . clone ( ) ) . map_err ( Error :: CLValue ) ? ; let call_stack_cl_value_bytes_len = call_stack_cl_value . inner_bytes ( ) . len ( ) as u32 ; if let Err ( error ) = self . write_host_buffer ( call_stack_cl_value ) { return Ok ( Err ( error ) ) ; } let call_stack_cl_value_bytes_len_bytes = call_stack_cl_value_bytes_len . to_le_bytes ( ) ; if let Err ( error ) = self . memory . set ( result_size_ptr , & call_stack_cl_value_bytes_len_bytes ) { return Err ( Error :: Interpreter ( error . into ( ) ) . into ( ) ) ; } Ok ( Ok ( ( ) ) ) }
Load the uref known by the given name into the Wasm memory
Load the uref known by the given name into the Wasm memory
&mut self
call_stack_len_ptr
u32
result_size_ptr
u32
&mut self
call_stack_len_ptr
u32
result_size_ptr
u32