Skip to main content

Module util

Module util 

Source
Expand description

Widely useful small utilities.

Structs§

RetryingStderr
A Write for the supervisor’s own diagnostics on fd 2 that survives a NONBLOCKING description.

Constants§

STDERR_DIAGNOSTIC_DEADLINE
Total wall-clock ALL diagnostic writes in ONE PROCESS may spend waiting for a reader that is not draining. Hermit forks, so read the fork note below before treating this as the whole exit path’s budget.

Functions§

init_shared_stderr_deadline_origin
Create the origin cell every hermit process of this invocation shares.
punch_out_print
A simple debugging helper function that makes it easy to printf-debug through layers of stdout/stderr caputure, such as when running under buck test/tpx.
rcbs_to_duration
A helper function to convert a number of Retired Conditional Branches (RCBS) into a std::time::Duration via the NANOS_PER_RCB defined in types.rs.
truncated
A little better than the builtin string truncation in format strings, because it includes ellipses.