#[non_exhaustive]pub enum SpawnError {
Connect(ConnectError),
Launch(Error),
DaemonExited {
status: ExitStatus,
},
DeadlineExpired {
after: Duration,
last: Option<ConnectError>,
},
}Expand description
Why connect_or_spawn (or connect_or_spawn_with) failed to hand
back a connected Client.
Non-exhaustive: expect more variants.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Connect(ConnectError)
The first probe failed for a reason other than “nothing is listening” or “listening but not yet answering”: a protocol mismatch, above all. A daemon that refuses on version skew is still a daemon; launching a second one would fail identically.
Launch(Error)
The caller-supplied launcher itself returned an io::Error:
Command::spawn() failed before any daemon process existed to probe.
DaemonExited
The launched child exited with a status other than
DAEMON_ALREADY_RUNNING before any later probe succeeded. Any
other non-zero (or signalled) exit is treated as fatal rather than
burning the rest of the deadline probing a corpse; an exit carrying
DAEMON_ALREADY_RUNNING is the losing side of a cold-start race
(another process’s flock(2) won) and is not reported this way.
Fields
status: ExitStatusThe child’s own exit status.
DeadlineExpired
No probe succeeded before opts.deadline elapsed.
Fields
after: DurationThe budget that was exceeded: opts.deadline, not the
wall-clock time actually spent.
last: Option<ConnectError>The most recent probe failure, if any probe was attempted: says whether nothing was listening, or something never answered.
Implementations§
Source§impl SpawnError
impl SpawnError
Sourcepub const fn exit_code(&self) -> u8
pub const fn exit_code(&self) -> u8
The shep_core::exit code a process stopping on this error uses.
A connect keeps its own code, so a refusal stays a protocol mismatch through autostart. Every other way autostart ends, nothing answers.
Trait Implementations§
Source§impl Debug for SpawnError
impl Debug for SpawnError
Source§impl Display for SpawnError
impl Display for SpawnError
Source§impl Error for SpawnError
impl Error for SpawnError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()