pub struct ProcessExecutor<'a> { /* private fields */ }Expand description
Process executor for running commands and code in sandboxes
Implementations§
Source§impl<'a> ProcessExecutor<'a>
impl<'a> ProcessExecutor<'a>
Sourcepub fn new(client: &'a DaytonaClient) -> Self
pub fn new(client: &'a DaytonaClient) -> Self
Create a new process executor
Sourcepub async fn execute_command(
&self,
sandbox_id: &Uuid,
command: &str,
) -> Result<ExecuteResponse>
pub async fn execute_command( &self, sandbox_id: &Uuid, command: &str, ) -> Result<ExecuteResponse>
Execute a raw command in a sandbox
Sourcepub async fn execute_with_options(
&self,
sandbox_id: &Uuid,
request: ExecuteRequest,
) -> Result<ExecuteResponse>
pub async fn execute_with_options( &self, sandbox_id: &Uuid, request: ExecuteRequest, ) -> Result<ExecuteResponse>
Execute with custom options
Sourcepub async fn execute_code(
&self,
sandbox_id: &Uuid,
language: Language,
code: &str,
) -> Result<ExecuteResponse>
pub async fn execute_code( &self, sandbox_id: &Uuid, language: Language, code: &str, ) -> Result<ExecuteResponse>
Execute code in a specific language
Sourcepub async fn execute_code_stdin(
&self,
sandbox_id: &Uuid,
language: Language,
code: &str,
) -> Result<ExecuteResponse>
pub async fn execute_code_stdin( &self, sandbox_id: &Uuid, language: Language, code: &str, ) -> Result<ExecuteResponse>
Execute code using stdin (for simpler cases)
Sourcepub async fn run_script(
&self,
sandbox_id: &Uuid,
script: &str,
) -> Result<ExecuteResponse>
pub async fn run_script( &self, sandbox_id: &Uuid, script: &str, ) -> Result<ExecuteResponse>
Run a shell script
Sourcepub async fn install_packages(
&self,
sandbox_id: &Uuid,
language: Language,
packages: Vec<String>,
) -> Result<ExecuteResponse>
pub async fn install_packages( &self, sandbox_id: &Uuid, language: Language, packages: Vec<String>, ) -> Result<ExecuteResponse>
Install packages in the sandbox
Sourcepub async fn create_session(
&self,
sandbox_id: &Uuid,
session_id: &str,
) -> Result<()>
pub async fn create_session( &self, sandbox_id: &Uuid, session_id: &str, ) -> Result<()>
Create a new session for persistent command execution
Sourcepub async fn delete_session(
&self,
sandbox_id: &Uuid,
session_id: &str,
) -> Result<()>
pub async fn delete_session( &self, sandbox_id: &Uuid, session_id: &str, ) -> Result<()>
Delete a session
Sourcepub async fn get_session(
&self,
sandbox_id: &Uuid,
session_id: &str,
) -> Result<Session>
pub async fn get_session( &self, sandbox_id: &Uuid, session_id: &str, ) -> Result<Session>
Get session information
Sourcepub async fn execute_session_command(
&self,
sandbox_id: &Uuid,
session_id: &str,
request: SessionExecuteRequest,
) -> Result<SessionExecuteResponse>
pub async fn execute_session_command( &self, sandbox_id: &Uuid, session_id: &str, request: SessionExecuteRequest, ) -> Result<SessionExecuteResponse>
Execute a command in a session
Sourcepub async fn get_session_command(
&self,
sandbox_id: &Uuid,
session_id: &str,
command_id: &str,
) -> Result<SessionCommand>
pub async fn get_session_command( &self, sandbox_id: &Uuid, session_id: &str, command_id: &str, ) -> Result<SessionCommand>
Get session command result
Sourcepub async fn get_session_command_logs(
&self,
sandbox_id: &Uuid,
session_id: &str,
command_id: &str,
) -> Result<String>
pub async fn get_session_command_logs( &self, sandbox_id: &Uuid, session_id: &str, command_id: &str, ) -> Result<String>
Get session command logs
Sourcepub async fn get_project_dir(&self, sandbox_id: &Uuid) -> Result<String>
pub async fn get_project_dir(&self, sandbox_id: &Uuid) -> Result<String>
Get project directory
Auto Trait Implementations§
impl<'a> Freeze for ProcessExecutor<'a>
impl<'a> !RefUnwindSafe for ProcessExecutor<'a>
impl<'a> Send for ProcessExecutor<'a>
impl<'a> Sync for ProcessExecutor<'a>
impl<'a> Unpin for ProcessExecutor<'a>
impl<'a> !UnwindSafe for ProcessExecutor<'a>
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