pub struct Context {
pub vars: HashMap<String, Value>,
}Expand description
Holds the named variable bindings for a formula evaluation.
All keys are stored and looked up in uppercase, so variable names are
case-insensitive (A1, a1, and A1 all refer to the same binding).
Fields§
§vars: HashMap<String, Value>Implementations§
Source§impl Context
impl Context
Sourcepub fn new(vars: HashMap<String, Value>) -> Self
pub fn new(vars: HashMap<String, Value>) -> Self
Create a Context from a map of variable name → value.
Keys are normalised to uppercase on insertion.
Sourcepub fn get(&self, name: &str) -> Value
pub fn get(&self, name: &str) -> Value
Look up a variable by name (case-insensitive). Returns Value::Empty if not found.
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnsafeUnpin for Context
impl UnwindSafe for Context
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more