pub struct Context { /* private fields */ }
Implementations§
Source§impl Context
impl Context
Sourcepub fn with_variable(self, name: &str, val: f32) -> Self
pub fn with_variable(self, name: &str, val: f32) -> Self
Adds a variable to the context, overwriting it if already existing.
§Examples
Basic usage:
use math_engine::context::Context;
let ctx = Context::new().with_variable("x", 32.0);
Sourcepub fn add_variable(&mut self, name: &str, val: f32) -> Result<(), ContextError>
pub fn add_variable(&mut self, name: &str, val: f32) -> Result<(), ContextError>
pub fn get_variable(&self, name: &String) -> Result<f32, ContextError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin 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