diff --git a/src/context.rs b/src/context.rs index 5a874ca4..cd424b52 100644 --- a/src/context.rs +++ b/src/context.rs @@ -118,6 +118,11 @@ impl Context { self.data.get(index) } + /// Returns a mutable reference to the value at a given key index. + pub fn get_mut(&mut self, index: &str) -> Option<&mut Value> { + self.data.get_mut(index) + } + /// Remove a key from the context, returning the value at the key if the key was previously inserted into the context. pub fn remove(&mut self, index: &str) -> Option { self.data.remove(index)