pub struct ExecProcess { /* private fields */ }Expand description
A handle to a running command. Drop or ExecProcess::close releases the
stream without killing the command.
Implementations§
Source§impl ExecProcess
impl ExecProcess
Sourcepub fn exec_request_id(&self) -> &str
pub fn exec_request_id(&self) -> &str
The durable server-assigned id for this exec, taken from the Started
frame. Identifies the command for wait, cancel, resize, and stdin RPCs.
Sourcepub fn idempotency_key(&self) -> &str
pub fn idempotency_key(&self) -> &str
The idempotency key this exec launched with: the caller’s, or the one
minted in start when none was supplied.
Sourcepub fn reader(&self, which: OutputStream) -> StreamReader
pub fn reader(&self, which: OutputStream) -> StreamReader
Create a reader over a live output stream. A fresh reader replays the retained tail from the start, then follows live.
Sourcepub fn reader_async(&self, which: OutputStream) -> AsyncStreamReader
pub fn reader_async(&self, which: OutputStream) -> AsyncStreamReader
Create an async reader over a live output stream (the awaiting twin of
reader).
Sourcepub fn poll(&self) -> Option<Result<i32, SailError>>
pub fn poll(&self) -> Option<Result<i32, SailError>>
Returns the exit code if the Exit frame arrived on the stream, mapping a
not-a-real-result terminal status to its error. None means the result
is not known on the stream yet. wait is authoritative.
Sourcepub async fn wait(&self) -> Result<ExecResult, SailError>
pub async fn wait(&self) -> Result<ExecResult, SailError>
Wait for the command to finish and return its buffered result.
A clean Exit resolves from the local rings; a stream that ended without
one (or whose tail is truncated or short) falls back to WaitSailboxExec,
which reattaches to the guest session for the authoritative result,
retrying a not-ready box for the exec’s configured retry_timeout budget.
Sourcepub async fn cancel(
&self,
signal: CancelSignal,
retry: RetryBudget,
) -> Result<(), SailError>
pub async fn cancel( &self, signal: CancelSignal, retry: RetryBudget, ) -> Result<(), SailError>
Signal the command: CancelSignal::Interrupt (SIGINT) or
CancelSignal::Kill (SIGKILL).
Sourcepub async fn resize(&self, cols: u32, rows: u32)
pub async fn resize(&self, cols: u32, rows: u32)
Set the pty window for a pty exec. Advisory and best-effort: an
unknown, finished, or not-yet-placed exec is a server no-op, and a
transient transport error is swallowed (the next resize resends).
Sourcepub async fn write_stdin(&self, data: &[u8]) -> Result<(), SailError>
pub async fn write_stdin(&self, data: &[u8]) -> Result<(), SailError>
Write to the command’s stdin. Chunked with absolute offsets; an uncertain mid-flight failure poisons the writer (a stale-offset resume could silently drop bytes). Blocks (with backoff) while the guest buffer is full.
Sourcepub async fn close_stdin(&self) -> Result<(), SailError>
pub async fn close_stdin(&self) -> Result<(), SailError>
Close the command’s stdin (send EOF).
Trait Implementations§
Source§impl Drop for ExecProcess
impl Drop for ExecProcess
Auto Trait Implementations§
impl !RefUnwindSafe for ExecProcess
impl !UnwindSafe for ExecProcess
impl Freeze for ExecProcess
impl Send for ExecProcess
impl Sync for ExecProcess
impl Unpin for ExecProcess
impl UnsafeUnpin for ExecProcess
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request