pub struct CodeExecutor;Expand description
代码执行器
Implementations§
Source§impl CodeExecutor
impl CodeExecutor
Sourcepub async fn execute_with_params(
code: &str,
language: LanguageScript,
params: Option<Value>,
timeout_seconds: Option<u64>,
) -> Result<CodeScriptExecutionResult>
pub async fn execute_with_params( code: &str, language: LanguageScript, params: Option<Value>, timeout_seconds: Option<u64>, ) -> Result<CodeScriptExecutionResult>
执行代码并传递参数,可选设置超时时间
Sourcepub async fn execute_with_params_compat(
code: &str,
language: LanguageScript,
params: Option<Value>,
) -> Result<CodeScriptExecutionResult>
pub async fn execute_with_params_compat( code: &str, language: LanguageScript, params: Option<Value>, ) -> Result<CodeScriptExecutionResult>
兼容旧代码的方法,不指定超时时间
Sourcepub async fn parse_execution_output(
stdout: &[u8],
stderr: &[u8],
) -> Result<CodeScriptExecutionResult>
pub async fn parse_execution_output( stdout: &[u8], stderr: &[u8], ) -> Result<CodeScriptExecutionResult>
解析执行输出
Auto Trait Implementations§
impl Freeze for CodeExecutor
impl RefUnwindSafe for CodeExecutor
impl Send for CodeExecutor
impl Sync for CodeExecutor
impl Unpin for CodeExecutor
impl UnwindSafe for CodeExecutor
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