pub enum ShellChild {
Direct {
child: Child,
tree: ProcessTree,
},
Helped(HelpedChild),
}Expand description
The shell of one MCP shell call, whoever its parent is.
On Unix the parent is this process’s spawn helper (shell::containment):
it holds the shell’s session and ends it should this process die. Where
there is no helper — Windows, a host that is not lean-ctx, a helper that
could not be started — this process is the parent, as it always was.
Variants§
Implementations§
Source§impl ShellChild
impl ShellChild
Sourcepub fn start(cmd: &mut Command) -> Result<StartedShell, String>
pub fn start(cmd: &mut Command) -> Result<StartedShell, String>
Starts the shell that cmd describes, in a session of its own on
Unix, with its output piped. cmd must have been through
ProcessTree::prepare and must not set its own standard streams.
Sourcepub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
The exit status, if the shell has exited. Reaps a direct child.
Sourcepub fn kill(&mut self)
pub fn kill(&mut self)
Ends the shell and everything it started (ProcessTree::kill). The
group is signalled by the shell’s parent, while the shell is unreaped.
Sourcepub fn release(self) -> Option<&'static str>
pub fn release(self) -> Option<&'static str>
Hands the tree back after the command exited on its own
(ProcessTree::release): what it left running stays.
Some: the fixed notice for a release that could not be handed to
the shell’s helper — whether what the command left running is still
running is then not known. The caller shows it with the result.
Sourcepub fn lost_notice(&self) -> Option<&'static str>
pub fn lost_notice(&self) -> Option<&'static str>
The fixed notice for a shell whose helper went away — before it said whether the command was started, or before the shell’s exit was known. The call’s outcome is then not known in full. Never the case for a direct child.
Auto Trait Implementations§
impl !Sync for ShellChild
impl Forget for ShellChild
impl Freeze for ShellChild
impl Move for ShellChild
impl RefUnwindSafe for ShellChild
impl Send for ShellChild
impl Unpin for ShellChild
impl UnsafeUnpin for ShellChild
impl UnwindSafe for ShellChild
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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