Struct arithmetic_eval::exec::WithEnvironment
source · pub struct WithEnvironment<'env, T> { /* private fields */ }
Expand description
Container for an ExecutableModule
together with an Environment
.
Implementations§
source§impl<T: 'static + Clone> WithEnvironment<'_, T>
impl<T: 'static + Clone> WithEnvironment<'_, T>
sourcepub fn run(self) -> Result<Value<T>, ErrorWithBacktrace>
pub fn run(self) -> Result<Value<T>, ErrorWithBacktrace>
Runs the module in the previously provided Environment
.
If a mutable reference was provided to the environment, the environment is modified to reflect top-level assignments in the module (both new and reassigned variables). If an error occurs, the assignments are performed up until the error (i.e., the environment is not rolled back on error).
§Errors
Returns an error if module execution fails.
Trait Implementations§
Auto Trait Implementations§
impl<'env, T> Freeze for WithEnvironment<'env, T>
impl<'env, T> !RefUnwindSafe for WithEnvironment<'env, T>
impl<'env, T> !Send for WithEnvironment<'env, T>
impl<'env, T> !Sync for WithEnvironment<'env, T>
impl<'env, T> Unpin for WithEnvironment<'env, T>
impl<'env, T> !UnwindSafe for WithEnvironment<'env, T>
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