Skip to main content

Candidate

Struct Candidate 

Source
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

Source

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.

Source

pub fn id(&self) -> ProcessId

OS process identity used by the live verifier.

Source

pub fn try_wait(&mut self) -> Result<Option<ExitStatus>>

Observe whether the candidate exited before readiness.

Source

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.

Source

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.

Source

pub fn selected(&mut self)

Mark the selection boundary before doing repairable follow-up work.

Trait Implementations§

Source§

impl Drop for Candidate

Source§

fn drop(&mut self)

Stop an unselected candidate. Dropping its process then reaps it.

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

Source§

fn from(daemon: DaemonChild) -> Self

Converts to this type from the input type.

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
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

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.