Skip to main content

ExecTeardown

Struct ExecTeardown 

Source
pub(super) struct ExecTeardown {
    stdio: (Receiver<Message>, Receiver<Message>),
    attach: SharedContainerAttach,
    token: CancellationToken,
    process: Arc<Process>,
    pub(super) kill: Arc<AtomicBool>,
    _stop_output: StopOutput,
}
Expand description

Ends an exec session however it ends, also if the client went away and the loop got aborted, or before the process even got started. The loop ends before the exit of the process if the connection is gone, if the client sent a message which is too large, or if the session hit the idle timeout or lost the exit. Only the last two kill the process, see ExecTeardown::kill, the others close its stdin or hang up its terminal. All but the hang-up stop the output, which nothing takes anymore.

Fields§

§stdio: (Receiver<Message>, Receiver<Message>)

The stdout and stderr channels of the process.

§attach: SharedContainerAttach§token: CancellationToken

Cancelled once the process exited.

§process: Arc<Process>

The process, which its watcher may reap before the token got cancelled, so it does not get signalled by its PID.

§kill: Arc<AtomicBool>

Set once the session ended with the idle timeout or lost the exit, which kills the process, like the reaper kills one after its timeout. Without a session the process would run on with nothing waiting for it. Otherwise it gets the end of its stdin and its output pipes closed, or the hang-up of its terminal, like a process started by the client itself once the client went away.

§_stop_output: StopOutput

Stops the read loops once the session took the output, after the exit, dropped after the rest.

Implementations§

Source§

impl ExecTeardown

Source

fn hang_up(&self)

Hang up the terminal like a closed connection does: signal the process group and the process. Only while the process was not reaped yet, its group may be gone and taken by another one otherwise, see Process::signal_group.

Trait Implementations§

Source§

impl Drop for ExecTeardown

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FutureExt for T

§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext wrapper. Read more
§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoRequest<T> for T

§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
§

impl<L> LayerExt<L> for L

§

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].
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more