Struct nu_system::ForegroundGuard
source · pub struct ForegroundGuard { /* private fields */ }Expand description
Keeps a specific already existing process in the foreground as long as the ForegroundGuard.
If the process needs to be spawned in the foreground, use ForegroundChild instead. This is
used to temporarily bring plugin processes into the foreground.
§OS-specific behavior
§Unix
If there is already a foreground external process running, spawned with ForegroundChild,
this expects the process ID to remain in the process group created by the ForegroundChild
for the lifetime of the guard, and keeps the terminal controlling process group set to that.
If there is no foreground external process running, this sets the foreground process group to
the plugin’s process ID. The process group that is expected can be retrieved with
.pgrp() if different from the plugin process ID.
§Other systems
It does nothing special on non-unix systems.
Implementations§
Trait Implementations§
source§impl Debug for ForegroundGuard
impl Debug for ForegroundGuard
Auto Trait Implementations§
impl Freeze for ForegroundGuard
impl RefUnwindSafe for ForegroundGuard
impl Send for ForegroundGuard
impl Sync for ForegroundGuard
impl Unpin for ForegroundGuard
impl UnwindSafe for ForegroundGuard
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
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