pub struct StreamingExec { /* private fields */ }Expand description
Handle for reading streaming exec events.
Reads frames from the exec server: Data frames contain ExecChunk (stdout/stderr),
Control frames contain ExecExit (final exit code).
Implementations§
Source§impl StreamingExec
impl StreamingExec
Sourcepub fn input(&self) -> StreamingExecInput
pub fn input(&self) -> StreamingExecInput
Return a cloneable input handle for this running stream.
Sourcepub async fn write_stdin(&self, data: &[u8]) -> Result<()>
pub async fn write_stdin(&self, data: &[u8]) -> Result<()>
Write bytes to the running command’s stdin.
Sourcepub async fn close_stdin(&self) -> Result<()>
pub async fn close_stdin(&self) -> Result<()>
Close the running command’s stdin without stopping the process.
Sourcepub async fn flush(&self) -> Result<()>
pub async fn flush(&self) -> Result<()>
Request a flush of the guest’s buffered output (see
StreamingExecInput::flush).
Sourcepub async fn next_event(&mut self) -> Result<Option<ExecEvent>>
pub async fn next_event(&mut self) -> Result<Option<ExecEvent>>
Read the next event from the stream.
Returns None when the command has exited and all output has been read.
Sourcepub async fn cancel(&mut self) -> Result<()>
pub async fn cancel(&mut self) -> Result<()>
Request cancellation of the running streaming exec workload.
The guest exec server treats this as a best-effort container stop signal and should emit a final exit frame after terminating the child process.
Sourcepub async fn collect(self) -> Result<(ExecOutput, ExecMetrics)>
pub async fn collect(self) -> Result<(ExecOutput, ExecMetrics)>
Collect all remaining output and return the final result with metrics.
Consumes the stream, buffering all stdout/stderr until the command exits.
Sourcepub fn is_done(&self) -> bool
pub fn is_done(&self) -> bool
Whether the stream has finished (command exited or connection closed).
Sourcepub fn metrics(&self) -> ExecMetrics
pub fn metrics(&self) -> ExecMetrics
Get execution metrics so far.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for StreamingExec
impl !UnwindSafe for StreamingExec
impl Freeze for StreamingExec
impl Send for StreamingExec
impl Sync for StreamingExec
impl Unpin for StreamingExec
impl UnsafeUnpin for StreamingExec
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more