pub struct LiveCodeRunner { /* private fields */ }Expand description
Live code execution engine for interactive examples
Implementations§
Source§impl LiveCodeRunner
impl LiveCodeRunner
Sourcepub fn new() -> LiveCodeRunner
pub fn new() -> LiveCodeRunner
Create a new live code runner with default settings
Sourcepub fn with_config(
execution_timeout: Duration,
memory_limit: usize,
) -> LiveCodeRunner
pub fn with_config( execution_timeout: Duration, memory_limit: usize, ) -> LiveCodeRunner
Create with custom configuration
Sourcepub fn execute_example(
&self,
example: &CodeExample,
) -> Result<ExecutionResult, SklearsError>
pub fn execute_example( &self, example: &CodeExample, ) -> Result<ExecutionResult, SklearsError>
Execute a code example and return results
Sourcepub fn execute_code(&self, code: &str) -> Result<ExecutionResult, SklearsError>
pub fn execute_code(&self, code: &str) -> Result<ExecutionResult, SklearsError>
Execute code string directly
Sourcepub fn set_timeout(&mut self, timeout: Duration)
pub fn set_timeout(&mut self, timeout: Duration)
Set execution timeout
Sourcepub fn set_memory_limit(&mut self, limit: usize)
pub fn set_memory_limit(&mut self, limit: usize)
Set memory limit
Sourcepub fn set_unsafe_enabled(&mut self, enabled: bool)
pub fn set_unsafe_enabled(&mut self, enabled: bool)
Enable or disable unsafe code
Sourcepub fn set_sandboxed(&mut self, sandboxed: bool)
pub fn set_sandboxed(&mut self, sandboxed: bool)
Enable or disable sandboxing
Trait Implementations§
Source§impl Clone for LiveCodeRunner
impl Clone for LiveCodeRunner
Source§fn clone(&self) -> LiveCodeRunner
fn clone(&self) -> LiveCodeRunner
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for LiveCodeRunner
impl Debug for LiveCodeRunner
Source§impl Default for LiveCodeRunner
impl Default for LiveCodeRunner
Source§fn default() -> LiveCodeRunner
fn default() -> LiveCodeRunner
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LiveCodeRunner
impl RefUnwindSafe for LiveCodeRunner
impl Send for LiveCodeRunner
impl Sync for LiveCodeRunner
impl Unpin for LiveCodeRunner
impl UnwindSafe for LiveCodeRunner
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more