pub struct InterpreterBuilder { /* private fields */ }Expand description
Builder for configuring and constructing an Interpreter.
By default, both the standard library and LLM builtins are enabled.
Implementations§
Source§impl InterpreterBuilder
impl InterpreterBuilder
Sourcepub fn with_stdlib(self, enable: bool) -> Self
pub fn with_stdlib(self, enable: bool) -> Self
Enable or disable the standard library (default: true).
Sourcepub fn with_llm(self, enable: bool) -> Self
pub fn with_llm(self, enable: bool) -> Self
Enable or disable the LLM builtins (default: true).
Sourcepub fn with_sandbox(self, sandbox: Sandbox) -> Self
pub fn with_sandbox(self, sandbox: Sandbox) -> Self
Set the sandbox configuration to restrict dangerous operations.
Sourcepub fn with_allowed_paths(self, paths: Vec<PathBuf>) -> Self
pub fn with_allowed_paths(self, paths: Vec<PathBuf>) -> Self
Restrict file operations to the given directories.
Sourcepub fn without_stdlib(self) -> Self
pub fn without_stdlib(self) -> Self
Disable the standard library.
Sourcepub fn without_llm(self) -> Self
pub fn without_llm(self) -> Self
Disable the LLM builtins.
Sourcepub fn build(self) -> Interpreter
pub fn build(self) -> Interpreter
Build the Interpreter with the configured options.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for InterpreterBuilder
impl RefUnwindSafe for InterpreterBuilder
impl Send for InterpreterBuilder
impl Sync for InterpreterBuilder
impl Unpin for InterpreterBuilder
impl UnsafeUnpin for InterpreterBuilder
impl UnwindSafe for InterpreterBuilder
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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