Skip to main content

Crate rightkit_child_process

Crate rightkit_child_process 

Source
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::done proves it is alive.
AdoptedIdentity
A pid together with the start time and executable path that make it a name for exactly one process. See the module documentation.
AdoptedProcess
BudgetLabels
Names and scale of the load behind an IdleObservation, for IdleObservation::result_lines.
CapturedOutput
What a capture holds.
ConsecutiveFailures
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
HealthPolicy
HealthTracker
IdleObservation
What a process did over a quiet window: the idle figures a runtime budget names.
JobAssignmentFailure
Every failed assignment in a best-effort Windows spawn is retained.
OutputCapture
A background drain of one output stream into a bounded byte buffer. See the module documentation.
OwnedChild
OwnedCommand
ProcessHandle
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.
ProcessUsage
One snapshot of the current process’s resource usage.
RestartPermit
RestartPolicy
RestartTracker
StallConfig
StallWatchdog
A running watchdog. Dropping it stops and joins the thread.
StartToken
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.
StderrTail
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, so snapshot never returns more than max_bytes bytes.
SweepReport
The result of sweep, as pids.
TerminationOptions
UnixChild
A spawned Unix child. The same API as Windows’ WindowsChild: public stdio fields, id, try_wait, wait and kill. It does not expose the std Child, because a std reap the crate cannot see would make later group signals unsafe (see the module documentation).
UsageRates
Rates between two snapshots. Each rate is None when either snapshot lacks the counter.

Enums§

AdoptedSignal
How hard to stop a process. Windows has one way to stop a process, so both are the same there.
HealthOutcome
HealthProbe
IdentityCheck
What a pid names now, compared with a remembered identity.
JobAssignmentMode
ProcessPriority
Scheduling priority requested for the child. Normal (the default) means “inherit”: it leaves the spawn exactly as it was before this option existed, so the child keeps the parent’s priority class (Windows) or nice value (Unix). It does not reset a lowered parent back to normal. The other values only lower priority, which needs no privilege and never raises a value the child already inherits above a lower one.
ReapOutcome
RestartMode
RestartOutcome
SignalResult
The outcome of AdoptedIdentity::signal.
StallEvent
UnixContainment
WaitOutcome

Constants§

CREATE_NO_WINDOW
The Windows CREATE_NO_WINDOW creation flag, exposed on every platform so a caller that composes its own flags can OR it in.
DEFAULT_DROP_REAP_TIMEOUT
How long Drop waits for a killed leader to be reaped before handing the reap to a background thread.
DEFAULT_ENV_ALLOWLIST

Traits§

NoWindow
Suppresses the child’s console window on Windows. A no-op elsewhere.

Functions§

observe_idle
Sleeps duration on 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 reads process_usage instead.
process_usage
Resource usage of the current process, computed now.
read_bounded
Reads reader to its end on the calling thread, keeping the first max_bytes bytes. The rest is read and discarded. Use this when the caller can block until the stream closes.
sweep
Stops every process in targets that is still the process it was remembered as: a graceful signal to each, up to grace for them to leave, then a forced signal to those still present. A target whose pid names a different process is refused, never signalled. Targets are signalled in the order given; pass leaves first (the reverse of AdoptedIdentity::descendants).
sweep_descendants
sweep of root’s current descendants, leaves first. The root itself is left alone.

Type Aliases§

RawHandleOrFd