struct RuntimeOutput {
stderr: Arc<Mutex<Tail<STDERR_TAIL_SIZE>>>,
task: JoinHandle<()>,
}Expand description
The stdout and stderr of a runtime with pipes of its own, read in the background until they end. Only the end of stderr is kept, it holds the error, stdout is not of interest.
Fields§
§stderr: Arc<Mutex<Tail<STDERR_TAIL_SIZE>>>§task: JoinHandle<()>Implementations§
Source§impl RuntimeOutput
impl RuntimeOutput
Sourcefn spawn(stdout: Option<ChildStdout>, stderr: Option<ChildStderr>) -> Self
fn spawn(stdout: Option<ChildStdout>, stderr: Option<ChildStderr>) -> Self
Start reading the pipes of a runtime in the background.
Sourceasync fn read(
reader: impl AsyncRead + Unpin,
buf: Option<&Mutex<Tail<STDERR_TAIL_SIZE>>>,
)
async fn read( reader: impl AsyncRead + Unpin, buf: Option<&Mutex<Tail<STDERR_TAIL_SIZE>>>, )
Read until the end, keeping the end in buf if any. The reads go to
the scratch buffer of the thread, see with_scratch, so that the
task of a create or exec with a terminal carries no buffers of its
own.
Sourceasync fn finish_unless_stopped(
output: Option<Self>,
stop: &CancellationToken,
) -> Vec<u8> ⓘ
async fn finish_unless_stopped( output: Option<Self>, stop: &CancellationToken, ) -> Vec<u8> ⓘ
Wait for the end of the output for a while, a helper of the runtime
may hold the pipes open, but only briefly once the shutdown stopped
the call through stop, and return the end of stderr.
fn end(output: &Self) -> Vec<u8> ⓘ
Auto Trait Implementations§
impl Freeze for RuntimeOutput
impl RefUnwindSafe for RuntimeOutput
impl Send for RuntimeOutput
impl Sync for RuntimeOutput
impl Unpin for RuntimeOutput
impl UnsafeUnpin for RuntimeOutput
impl UnwindSafe for RuntimeOutput
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Applies the layer to a service and wraps it in [
Layered].