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: Stream) -> StreamReader
pub fn reader(&self, which: Stream) -> 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: Stream) -> AsyncStreamReader
pub fn reader_async(&self, which: Stream) -> 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_stream_ended(&self, timeout: Duration) -> bool
pub async fn wait_stream_ended(&self, timeout: Duration) -> bool
Block up to timeout for the output stream to end; returns whether it
has. Lets a synchronous caller stay responsive to its own signals and
stop conditions between ticks before committing to the blocking
wait resolve.
Sourcepub async fn wait(&self, retry_timeout: f64) -> Result<ExecResult, SailError>
pub async fn wait(&self, retry_timeout: f64) -> 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 polling
WaitSailboxExec for the authoritative persisted result.
Sourcepub async fn cancel(
&self,
force: bool,
retry_timeout: f64,
) -> Result<(), SailError>
pub async fn cancel( &self, force: bool, retry_timeout: f64, ) -> Result<(), SailError>
Signal the command: SIGINT by default, SIGKILL if force.
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).
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