Expand description
OwnedCommand::inherit_handles_only restricts inheritance to caller handles/fds plus stdio; Windows requires windows_spawn_config for opaque Command settings.
Modules§
- reveal
- Reveal a file or folder in the system file manager, or open it with its default handler,
through
OwnedCommand, and only inside caller-supplied roots.
Structs§
- Ack
- Handed to the watched party; calling
Ack::doneproves it is alive. - Adopted
Identity - A pid together with the start time and executable path that make it a name for exactly one process. See the module documentation.
- Adopted
Process - Budget
Labels - Names and scale of the load behind an
IdleObservation, forIdleObservation::result_lines. - Consecutive
Failures - Cap on restarts granted in a row without the replacement ever reporting ready.
- Cooldown
- Minimum spacing between expensive actions (HeardRight samples stacks at
most once a minute). Pure; the caller supplies
now. - Generation
- Health
Policy - Health
Tracker - Idle
Observation - What a process did over a quiet window: the idle figures a runtime budget names.
- JobAssignment
Failure - Every failed assignment in a best-effort Windows spawn is retained.
- Owned
Child - Owned
Command - Process
Handle - An independent exit reader. On Unix it shares the owner’s cached reap state; on Windows it owns a duplicated process handle, never a borrowed handle value. Keeping this reader alive does not keep an owned process tree alive.
- Process
Usage - One snapshot of the current process’s resource usage.
- Restart
Permit - Restart
Policy - Restart
Tracker - Stall
Config - Stall
Watchdog - A running watchdog. Dropping it stops and joins the thread.
- Start
Token - When a process started, in the host’s own unit (macOS: seconds and microseconds; Linux: clock ticks since boot and 0; Windows: 100 ns ticks since 1601 and 0). Comparable only on the host that produced it.
- Stderr
Tail - A background drain of one stderr stream. Keeps the most recent lines whose
total size is at most
max_bytes; older lines fall off the front. A single line that alone exceeds the budget is cut to its last bytes, sosnapshotnever returns more thanmax_bytesbytes. - Sweep
Report - The result of
sweep, as pids. - Termination
Options - Unix
Child - A spawned Unix child. The same API as Windows’
WindowsChild: public stdio fields,id,try_wait,waitandkill. It does not expose the stdChild, because a std reap the crate cannot see would make later group signals unsafe (see the module documentation). - Usage
Rates - Rates between two snapshots. Each rate is
Nonewhen either snapshot lacks the counter.
Enums§
- Adopted
Signal - How hard to stop a process. Windows has one way to stop a process, so both are the same there.
- Health
Outcome - Health
Probe - Identity
Check - What a pid names now, compared with a remembered identity.
- JobAssignment
Mode - Reap
Outcome - Restart
Mode - Restart
Outcome - Signal
Result - The outcome of
AdoptedIdentity::signal. - Stall
Event - Unix
Containment - Wait
Outcome
Constants§
- DEFAULT_
DROP_ REAP_ TIMEOUT - How long
Dropwaits for a killed leader to be reaped before handing the reap to a background thread. - DEFAULT_
ENV_ ALLOWLIST
Functions§
- observe_
idle - Sleeps
durationon the calling thread and reports the process’s usage over it. Run it after the load has stopped; it is for benches and tests, so a host readsprocess_usageinstead. - process_
usage - Resource usage of the current process, computed now.
- sweep
- Stops every process in
targetsthat is still the process it was remembered as: a graceful signal to each, up togracefor them to leave, then a forced signal to those still present. A target whose pid names a different process isrefused, never signalled. Targets are signalled in the order given; pass leaves first (the reverse ofAdoptedIdentity::descendants). - sweep_
descendants sweepofroot’s current descendants, leaves first. The root itself is left alone.