From e6bf41a10c22acdcf832c8e60b96ec7f4c46727d Mon Sep 17 00:00:00 2001 From: Sergey Pepyakin Date: Mon, 27 Nov 2017 20:39:27 +0300 Subject: [PATCH] Update documentation for ExternalVariableValue. --- src/interpreter/variable.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/interpreter/variable.rs b/src/interpreter/variable.rs index 50767ba..dade97c 100644 --- a/src/interpreter/variable.rs +++ b/src/interpreter/variable.rs @@ -23,7 +23,13 @@ pub enum VariableType { pub trait ExternalVariableValue { /// Get variable value. fn get(&self) -> RuntimeValue; + /// Set variable value. + /// + /// WebAssembly specificaiton [requires][0] that if global variable is immutable, then + /// it should remain unchanged. + /// + /// [0]: https://webassembly.github.io/spec/appendix/properties.html#global-instance fn set(&mut self, value: RuntimeValue) -> Result<(), Error>; }