Skip to main content

ExitInfo

Struct ExitInfo 

Source
pub struct ExitInfo {
    pub code: Option<i32>,
    pub signal: Option<i32>,
}
Expand description

Why a sheep’s process most recently stopped existing under this daemon.

Not shep-daemon’s own ExitOutcome reused directly: that type lives behind the spawn-runner seam (ProcessRunner::wait, in shep-daemon’s runner module) and is free to grow with whatever the real runner needs to observe next without dragging a breaking wire change behind it — this one only ever grows on its own say-so. The two happen to carry the same two fields today because the runner’s own observation IS the honest exit outcome; shep-daemon converts one into the other at the point it records it (Actor::handle_exited), rather than this crate depending on shep-daemon’s internals to reuse its type.

A struct, not two flat Option<i32> fields on ProcessInfo directly: with two flat fields, “this sheep has never exited under this daemon” and “it exited, killed by a signal this daemon did not name” are both all-None, and a reader cannot tell those apart. Nested behind ProcessInfo::last_exit’s own Option, that ambiguity moves up a level where it belongs: None there means “never exited”; Some means “exited, and here is what this daemon knows about it” — which itself mirrors the OS’s own exited-normally/killed-by-signal split (WIFEXITED/WIFSIGNALED): ordinarily exactly one of code/signal is Some. A reader must not assume both can never be None together, though — that would still mean “this daemon recorded an exit; it could not characterize how” rather than “this sheep never exited”, and this type does not forbid it.

No #[non_exhaustive], unlike every other struct on this wire: those grow because a discriminator does (ProcessInfo’s own doc lists its four so far); code/signal is already the complete exited-normally/killed-by-signal split the runner exposes, this crate has no libc to derive a richer wait-status decomposition from even if it wanted one, and there is no forecast next field. Adding the attribute back later is a compatible change the day a real need appears (IR-16 style); carrying it now on nothing but “might grow” is the exact speculative case IR-20 warns against.

Fields§

§code: Option<i32>

The process’s own exit code, set on a normal exit (WIFEXITED).

§signal: Option<i32>

The raw unix signal number that ended the process, set when it did not exit on its own (WIFSIGNALED) — an operator’s own shep stop or shep delete included: the process still genuinely stopped by a signal, and that stays true information even though shep, not a crash, is what asked for it. Raw and platform-specific for the same reason crate::signals::OperatorSignal carries no such accessor — see that type’s own module doc — so rendering this as a name (SIGKILL rather than 9) is a job for whichever OS-aware layer reads it, never for this crate.

Trait Implementations§

Source§

impl Clone for ExitInfo

Source§

fn clone(&self) -> ExitInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ExitInfo

Source§

impl Debug for ExitInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for ExitInfo

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Eq for ExitInfo

Source§

impl PartialEq for ExitInfo

Source§

fn eq(&self, other: &ExitInfo) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for ExitInfo

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for ExitInfo

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.