pub(crate) struct ExecStart {
container_io: ContainerIO,
pidfile: TempFile,
args: ExecArgs,
runtime: PathBuf,
}Expand description
An exec while it gets started. An exec_sync and a streaming exec
set it up the same way, they differ in how they wait for the runtime and
take the output, see ExecStart::run and ExecStart::watch.
Fields§
§container_io: ContainerIOThe IO of the process, with the console socket of a terminal.
pidfile: TempFileWhere the runtime writes the PID of the process. Removed once the
runtime wrote the PID, see ExecStart::watch, or with a start which
failed.
args: ExecArgs§runtime: PathBufImplementations§
Source§impl ExecStart
impl ExecStart
Sourcepub(crate) fn new(
config: &Config,
id: &str,
tty: bool,
command: &[String],
cgroup_manager: CgroupManager,
pidfile_prefix: &str,
) -> Result<Self>
pub(crate) fn new( config: &Config, id: &str, tty: bool, command: &[String], cgroup_manager: CgroupManager, pidfile_prefix: &str, ) -> Result<Self>
Set up an exec of command in the container id, with a terminal if
tty. The PID file in the runtime directory starts with
pidfile_prefix, which tells the kind of exec apart.
Sourcepub(crate) fn collect_stdio(&self, stdout: bool, stderr: bool) -> Result<()>
pub(crate) fn collect_stdio(&self, stdout: bool, stderr: bool) -> Result<()>
Read the output while the runtime runs, see
ContainerIO::collect_stdio.
Sourcepub(crate) fn stdio(&self) -> Result<(Receiver<Message>, Receiver<Message>)>
pub(crate) fn stdio(&self) -> Result<(Receiver<Message>, Receiver<Message>)>
The stdout and stderr channels of the process, see
ContainerIO::stdio.
Sourcepub(crate) fn terminal(&self) -> Option<&Terminal>
pub(crate) fn terminal(&self) -> Option<&Terminal>
The terminal of the process, none with pipes, see
ContainerIO::terminal.
Sourcepub(crate) async fn run(
&mut self,
reaper: &ChildReaper,
stdin: bool,
deadline: Instant,
) -> Result<StartedChild>
pub(crate) async fn run( &mut self, reaper: &ChildReaper, stdin: bool, deadline: Instant, ) -> Result<StartedChild>
Run the runtime, with stdin for the process, and kill it at the
deadline if it hangs, see ChildReaper::create_child. The caller
reports a failure with ExecStart::runtime_error.
Sourcepub(crate) async fn runtime_error(&self, e: Error) -> Error
pub(crate) async fn runtime_error(&self, e: Error) -> Error
The error of a runtime which failed to start the process, with its
stderr, see ContainerIO::runtime_error.
Sourcepub(crate) fn watch(
self,
reaper: &ChildReaper,
id: Box<str>,
started: StartedChild,
timeout: Option<Instant>,
) -> Result<WatchedExec>
pub(crate) fn watch( self, reaper: &ChildReaper, id: Box<str>, started: StartedChild, timeout: Option<Instant>, ) -> Result<WatchedExec>
Register the process the runtime started under the id of its
container, the process gets killed at timeout, see
ChildReaper::watch_exec.
Auto Trait Implementations§
impl !Freeze for ExecStart
impl !RefUnwindSafe for ExecStart
impl !UnwindSafe for ExecStart
impl Send for ExecStart
impl Sync for ExecStart
impl Unpin for ExecStart
impl UnsafeUnpin for ExecStart
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<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>
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>,
Layered].