openfunctions_rs/runtime/
environment.rs1use std::collections::HashMap;
4
5pub struct Environment {
7 variables: HashMap<String, String>,
8}
9
10impl Environment {
11 pub fn new() -> Self {
13 Self {
14 variables: HashMap::new(),
15 }
16 }
17
18 pub fn get_base_env(&self) -> HashMap<String, String> {
20 self.variables.clone()
21 }
22
23 pub fn set(&mut self, key: String, value: String) {
25 self.variables.insert(key, value);
26 }
27}
28
29impl Default for Environment {
30 fn default() -> Self {
31 Self::new()
32 }
33}