pub struct CodeExecutionConfig {
pub timeout: Duration,
pub max_output_size: usize,
pub allowed_languages: Vec<ProgrammingLanguage>,
pub capture_stderr: bool,
pub working_dir: Option<String>,
pub env_vars: Vec<(String, String)>,
}Expand description
Configuration for the code execution tool.
Fields§
§timeout: DurationMaximum execution time.
max_output_size: usizeMaximum output size in bytes.
allowed_languages: Vec<ProgrammingLanguage>Allowed languages.
capture_stderr: boolWhether to capture stderr.
working_dir: Option<String>Working directory.
env_vars: Vec<(String, String)>Environment variables.
Implementations§
Source§impl CodeExecutionConfig
impl CodeExecutionConfig
Sourcepub fn timeout_secs(self, secs: u64) -> Self
pub fn timeout_secs(self, secs: u64) -> Self
Set timeout in seconds.
Sourcepub fn max_output_size(self, size: usize) -> Self
pub fn max_output_size(self, size: usize) -> Self
Set max output size.
Sourcepub fn allowed_languages(self, langs: Vec<ProgrammingLanguage>) -> Self
pub fn allowed_languages(self, langs: Vec<ProgrammingLanguage>) -> Self
Set allowed languages.
Sourcepub fn allow_language(self, lang: ProgrammingLanguage) -> Self
pub fn allow_language(self, lang: ProgrammingLanguage) -> Self
Add an allowed language.
Sourcepub fn capture_stderr(self, capture: bool) -> Self
pub fn capture_stderr(self, capture: bool) -> Self
Set capture stderr.
Trait Implementations§
Source§impl Clone for CodeExecutionConfig
impl Clone for CodeExecutionConfig
Source§fn clone(&self) -> CodeExecutionConfig
fn clone(&self) -> CodeExecutionConfig
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 CodeExecutionConfig
impl Debug for CodeExecutionConfig
Source§impl Default for CodeExecutionConfig
impl Default for CodeExecutionConfig
Source§impl<'de> Deserialize<'de> for CodeExecutionConfig
impl<'de> Deserialize<'de> for CodeExecutionConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CodeExecutionConfig
impl RefUnwindSafe for CodeExecutionConfig
impl Send for CodeExecutionConfig
impl Sync for CodeExecutionConfig
impl Unpin for CodeExecutionConfig
impl UnwindSafe for CodeExecutionConfig
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