pub struct Candidate { /* private fields */ }Expand description
A newly spawned candidate is disposable until its selection commits. Dropping a selected candidate only reaps it; it never terminates the daemon.
Implementations§
Source§impl Candidate
impl Candidate
Sourcepub fn new(process: Child) -> Self
pub fn new(process: Child) -> Self
Take ownership immediately after spawning a staged candidate.
With local this also opens the candidate’s exit handle, while
nothing has waited for the child, so the handle follows this process
even if its PID is reused after a later reap.
Sourcepub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>
Observe whether the candidate exited before readiness.
Sourcepub fn exit_handle(&mut self) -> Result<&mut ProcessHandle>
pub fn exit_handle(&mut self) -> Result<&mut ProcessHandle>
The candidate’s exit as an event, for a verifier that waits on it
between probes instead of sleeping. The handle is opened by
Self::new; this fails if that could not be done, and
Self::wait_until then asks the child directly.
Sourcepub fn wait_until(&mut self, deadline: Instant) -> Result<Option<ExitStatus>>
pub fn wait_until(&mut self, deadline: Instant) -> Result<Option<ExitStatus>>
Block until the candidate exits or deadline passes: its exit status,
or None while it still runs.
Trait Implementations§
Source§impl From<DaemonChild> for Candidate
Available on crate feature launch only.A daemon started by DaemonCommand as a
candidate: dropped before Candidate::selected, it is stopped. Take its
readiness channel first; the candidate keeps it but does not give it out.
impl From<DaemonChild> for Candidate
launch only.A daemon started by DaemonCommand as a
candidate: dropped before Candidate::selected, it is stopped. Take its
readiness channel first; the candidate keeps it but does not give it out.