pub struct SessionRpcShell<'a> { /* private fields */ }Expand description
session.shell.* RPCs.
Implementations§
Source§impl<'a> SessionRpcShell<'a>
impl<'a> SessionRpcShell<'a>
Sourcepub async fn exec(
&self,
params: ShellExecRequest,
) -> Result<ShellExecResult, Error>
pub async fn exec( &self, params: ShellExecRequest, ) -> Result<ShellExecResult, Error>
Starts a shell command and streams output through session notifications. The command runs as the leader of its own process group (POSIX) or in a dedicated job object (Windows), so a forced termination — via “shell.kill”, the request timeout, or session disposal — signals that whole group/job rather than only the direct child. Two gaps are worth planning for: a command that exits on its own does not trigger that teardown, and on POSIX a descendant that moves itself into a new session or process group (for example via “setsid”) leaves the signalled group, so either can leave a background process running.
Wire method: session.shell.exec.
§Parameters
params- Shell command to run, with optional working directory and timeout in milliseconds.
§Returns
Identifier of the spawned process, used to correlate streamed output and exit notifications.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn kill(
&self,
params: ShellKillRequest,
) -> Result<ShellKillResult, Error>
pub async fn kill( &self, params: ShellKillRequest, ) -> Result<ShellKillResult, Error>
Sends a signal to a shell process previously started via “shell.exec”. The signal targets the command’s whole process group (POSIX) or job object (Windows), so descendants still in that group are signalled too, not just the direct child. On POSIX a descendant that moved itself into a new session or process group (for example via “setsid”) is no longer in the signalled group and survives.
Wire method: session.shell.kill.
§Parameters
params- Identifier of a process previously returned by “shell.exec” and the signal to send.
§Returns
Indicates whether the signal was delivered; false if the process was unknown or already exited.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn execute_user_requested(
&self,
params: ShellExecuteUserRequestedRequest,
) -> Result<UserRequestedShellCommandResult, Error>
pub async fn execute_user_requested( &self, params: ShellExecuteUserRequestedRequest, ) -> Result<UserRequestedShellCommandResult, Error>
Executes a user-requested shell command through the session runtime.
Wire method: session.shell.executeUserRequested.
§Parameters
params- User-requested shell command and cancellation handle.
§Returns
Result of a user-requested shell command.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Sourcepub async fn cancel_user_requested(
&self,
params: ShellCancelUserRequestedRequest,
) -> Result<CancelUserRequestedShellCommandResult, Error>
pub async fn cancel_user_requested( &self, params: ShellCancelUserRequestedRequest, ) -> Result<CancelUserRequestedShellCommandResult, Error>
Cancels a user-requested shell command by request ID.
Wire method: session.shell.cancelUserRequested.
§Parameters
params- User-requested shell execution cancellation handle.
§Returns
Cancellation result for a user-requested shell command.
Experimental. This API is part of an experimental wire-protocol surface and may change or be removed in future SDK or CLI releases. Pin both the SDK and CLI versions if your code depends on it.
Trait Implementations§
Source§impl<'a> Clone for SessionRpcShell<'a>
impl<'a> Clone for SessionRpcShell<'a>
Source§fn clone(&self) -> SessionRpcShell<'a>
fn clone(&self) -> SessionRpcShell<'a>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more