Skip to main content

DetConfig

Struct DetConfig 

Source
pub struct DetConfig {
Show 89 fields pub virtualize_time: bool, pub virtualize_cpuid: bool, pub cpu_profile: CpuProfile, pub cpu_profile_host: Option<HostXstate>, pub backend: BackendCapabilities, pub guest_may_inherit_a_terminal: bool, pub in_guest_detlog_forward_policy: Option<String>, pub in_guest_site_patching_off: bool, pub launch_image: Option<LaunchImage>, pub inherited_seccomp: InheritedSeccomp, pub epoch: DateTime<Utc>, pub seed: u64, pub rng_seed: Option<u64>, pub fuzz_seed: Option<u64>, pub clock_multiplier: Option<f64>, pub virtualize_metadata: bool, pub mountinfo_root_rewrites: Vec<MountInfoRootRewrite>, pub mountinfo_device_rewrites: Vec<(u64, u64)>, pub mountinfo_mount_ids: Vec<u64>, pub mountinfo_mount_ids_captured: bool, pub mountinfo_mount_namespace: Option<MountNamespaceIdentity>, pub mount_id_assignment_order: Vec<u64>, pub container_mount_table: Option<ContainerMountTable>, pub sequentialize_threads: bool, pub runs_post_fork: RunsPostFork, pub passthru_opt: bool, pub imprecise_timers: bool, pub signal_state_copy: bool, pub signal_delivery_check_fatal: bool, pub chaos: bool, pub fuzz_futexes: bool, pub chaos_target_races: bool, pub chaos_per_thread_slowdown: bool, pub chaos_slowdown_max_factor: f64, pub chaos_epoch_length_ns: u64, pub record_preemptions: bool, pub record_preemptions_to: Option<PathBuf>, pub replay_preemptions_from: Option<PathBuf>, pub replay_schedule_from: Option<PathBuf>, pub replay_exhausted_panic: bool, pub die_on_desync: bool, pub stacktrace_event: Vec<(u64, Option<PathBuf>)>, pub stacktrace_signal: Option<SigWrapper>, pub preemption_stacktrace: bool, pub preemption_stacktrace_log_file: Option<PathBuf>, pub deterministic_io: bool, pub panic_on_unsupported_syscalls: bool, pub exit_on_unsupported_syscall: bool, pub shutdown_on_unsupported_syscall: bool, pub unsupported_syscall_report_fd: Option<i32>, pub panic_on_rcb_overshoot: bool, pub has_uts_namespace: bool, pub replay_data: Option<PathBuf>, pub kill_daemons: bool, pub gdbserver: bool, pub gdbserver_port: u16, pub max_timeslice: Option<NonZero<u64>>, pub target_timeslice: Option<NonZero<u64>>, pub target_timeslice_syscalls_only: bool, pub futex_wake_yields: bool, pub pipe_wake_latency: Option<u64>, pub scheduler_turn_cost: Option<NonZero<u64>>, pub sigint_instakill: bool, pub warn_non_zero_binds: bool, pub sched_heuristic: SchedHeuristic, pub sched_seed: Option<u64>, pub network_trace: NetworkTraceConfig, pub sched_sticky_random_param: f64, pub recordreplay_modes: bool, pub replaying: bool, pub stop_after_turn: Option<u64>, pub stop_after_iter: Option<u64>, pub debug_externalize_sockets: bool, pub debug_futex_mode: BlockingMode, pub no_rcb_time: bool, pub detlog_heap: bool, pub detlog_stack: bool, pub detlog_regs: bool, pub detlog_io_buffers: bool, pub detlog_regs_cadence: u64, pub sysinfo_uptime_offset: u64, pub memory: u64, pub proc_level: ProcLevel, pub interrupt_at: Vec<(DetPid, u64)>, pub happens_before: Option<HappensBeforeProgram>, pub record_host_inputs: bool, pub host_input_log: Option<PathBuf>, pub untraced_code_range: Option<(u64, u64)>, pub fatal_core_capture: Option<FatalCoreCapture>,
}
Expand description

Configuration options for detcore.

Fields§

§virtualize_time: bool

Disable virtual/logical time. Note that virtual time is required for virtual metadata.

§virtualize_cpuid: bool

Disable virtual cpuid

§cpu_profile: CpuProfile

The CPU the guest sees: x86-64-v2 (the default) or x86-64-v3, offered only on qualified ptrace hosts. The long help states what the qualification leaves uncovered.

§cpu_profile_host: Option<HostXstate>

The host facts a v3 guest’s leaf 0xD and xstate answers come from, set by the CLI after the host qualifies; None under v2. Neither profile field enters the legacy form the DBT runtime reads (DBT refuses v3).

§backend: BackendCapabilities

How the execution backend runs the guest, as the backend reports it through Reverie (reverie::Backend::capabilities).

Detcore reads facts about the backend only from here, never from the backend’s name, so a new backend is modelled correctly by reporting its capabilities. The host copies the running backend’s answer into this field before the run starts. The default, DEFAULT_BACKEND_CAPABILITIES, describes a ptrace-hosted guest, the backend Detcore’s own tests use, with the three host-set facts and reports_sigreturns off.

JSON that the guest can see is written by to_legacy_backend_json, which carries this field as the separate keys used before it existed; from_legacy_backend_json reads them back.

§guest_may_inherit_a_terminal: bool

The guest may start with a terminal: one of the launcher’s standard descriptors is a terminal, the launcher has a controlling terminal that the guest inherits with its session, or the launcher could not tell. Such a terminal makes Linux send signals at moments the host sets: SIGHUP and SIGCONT when it hangs up, SIGINT, SIGQUIT and SIGTSTP for its interrupt, quit and suspend characters, SIGWINCH when it is resized, and SIGTTIN and SIGTTOU for a background process group’s reads and writes. The guest makes no traced call that arms them, so where Detcore treats such signals as reaching the guest from the host (the legacy bundled condition crate::bundled_signal_facts::host_timed_signal_sources_are_physical) the scheduler records all eight as host-timed for every process before the guest’s first instruction, and no gated wait ends for them (https://github.com/rrnewton/hermit/issues/3146).

The host sets it while it prepares the backend configuration. It has no legacy key: to_legacy_backend_json leaves it out and from_legacy_backend_json reads it back as false.

§in_guest_detlog_forward_policy: Option<String>

The forwarding policy (detcore::detlog::ForwardPolicy::encode) every in-guest Tool must forward its DETLOG records with, on the socket Hermit passed it (hermit run --verify under SaBRe or in-guest LiteInst); None when no socket is passed.

The host sets it, not a flag, and every Tool image receives it in the configuration handshake on its coordinator connection, which guest code cannot change. A Tool image whose forwarder is missing, or forwards by another policy (guest code that ran first changed its private forwarding variables, so some records would be dropped before they are counted), then reports every forwarded-record count as UNCOUNTED (detcore::detlog::require_forwarding), so verification refuses the run instead of accepting a log without those records. Like guest_may_inherit_a_terminal, it has no legacy key.

§in_guest_site_patching_off: bool

Whether every in-guest Tool image must run with syscall site patching off and collect its exit statistics (hermit --backend=in-guest-trap).

The host sets it, not a flag, and every Tool image receives it in the configuration handshake on its coordinator connection, which guest code cannot change. The in-guest LiteInst runtime takes both settings from the guest environment, which guest code running before or during its installation could change, so once installation returns a Tool image compares the settings the runtime actually captured with this one and refuses to run the program when they differ (detcore::in_guest_site_patching). Like in_guest_detlog_forward_policy, it has no legacy key.

§launch_image: Option<LaunchImage>

The guest’s first image, as its /proc/self/exe link names it, and the image the kernel exec’d in its place where a launcher loads the guest (LaunchImage). Detcore answers that link from it until the guest’s next exec, which Detcore resolves itself. None leaves the first image’s link to the kernel.

The host sets it, not a flag, from the program it launches. Like in_guest_detlog_forward_policy it has no legacy key, so DBT’s legacy form never carries it.

§inherited_seccomp: InheritedSeccomp

The seccomp state the guest inherits from the thread that starts it (InheritedSeccomp). The caller that starts the guest states it, as only the caller knows the filters its launch installs, such as those of a pre_exec callback; hermit run measures it. Not stated, it is unknown. Nothing reads it. Whether a guest may start under an inherited filter is decided by the hermit command, before it starts the guest, from its own reading of /proc/self/status (host_seccomp::admit). It has no legacy key: to_legacy_backend_json leaves it out and from_legacy_backend_json reads it back as unknown.

§epoch: DateTime<Utc>

Epoch of the logical time.

This is the datetime from which all time and date modtimes begin and monotonically increase. It is in RFC3339 format such as 2026-01-01T00:00:00Z. The stable default here is for library callers and wire-format fixtures; the hermit run and hermit oci run commands replace an omitted CLI default with one host wall-clock sample taken before backend dispatch.

§seed: u64

Use this number to seed the PRNG randomness for both RNG and scheduler. This acts as a global fallback in case either sched_seed or rng-seed are not explicitly specified

§rng_seed: Option<u64>

Use this number to seed the PRNG that supplies randomness to the guest. This supplies guest system calls that expose randomness, as well as the /dev/[u]random files. It does not affect the rdrand instruction, which is disabled in the guest.

§fuzz_seed: Option<u64>

Seeds the PRNG which drives syscall response fuzzing (i.e. chaotically exercising syscall nondeterminism). Like other seeds, this is initialized from the --seed if not specifically provided.

§clock_multiplier: Option<f64>

Logical clock multiplier. Values above one make time appear to go faster within the sandbox.

§virtualize_metadata: bool

Disable substitution of virtual (deterministic) file metadata in lieu of the real metadata returned by stat/statx. This also preserves raw mountinfo device numbers so those interfaces continue to agree. Raw device values are host/filesystem observations and are not promised to reproduce across machines. Virtual metadata implies virtualize_time.

§mountinfo_root_rewrites: Vec<MountInfoRootRewrite>

Proven Hermit-owned mount roots to hide from /proc/*/mountinfo.

This is runtime provenance, not a user option. serde(default) keeps older serialized configurations compatible and makes backends which do not use the common container setup explicitly receive no rewrite claim.

§mountinfo_device_rewrites: Vec<(u64, u64)>

Backend-proven pairs of (mountinfo raw device, stat/statx raw device).

A backend may synthesize mountinfo independently from its pathname metadata implementation. These pairs state that the two raw numbers describe the same filesystem, so Detcore can feed both surfaces through one device identity. The pairs are runtime provenance, not a user option; an absent pair must never be inferred from numeric coincidence.

§mountinfo_mount_ids: Vec<u64>

Recording/container namespace mount IDs in canonical row order.

Detcore validates every /proc/*/mountinfo view against this order. It does not number mount IDs by position in it; see mount_id_assignment_order. It is runtime provenance rather than a user option; replay retains recording-time raw IDs because its read events contain recording-time kernel bytes.

§mountinfo_mount_ids_captured: bool

Whether mountinfo_mount_ids is an exact producer-owned snapshot.

The distinction matters for an empty mountinfo file: an absent snapshot asks Detcore to observe the completed guest namespace, while a captured empty snapshot must remain empty during replay.

§mountinfo_mount_namespace: Option<MountNamespaceIdentity>

The mount namespace mountinfo_mount_ids was captured in (MountNamespaceIdentity). A backend that checks its provenance (KVM) requires its own namespace to be this one, instead of recapturing the namespace’s rows: a host can detach a copied host mount from a private namespace at any time by removing that mount’s directory, so two captures of one namespace need not agree. None when nothing was captured, and in recordings. Runtime provenance, not a user option.

§mount_id_assignment_order: Vec<u64>

Raw mount IDs in the order Detcore numbered them for the guest.

Detcore numbers a raw mount ID when the guest first observes it through /proc/*/mountinfo or /proc/*/fdinfo/*; mountinfo_mount_ids only validates mountinfo views. A live run starts empty. Recording persists the completed order so replay gives every raw ID its recorded number rather than deriving one from its fresh namespace or launch descriptor shape.

§container_mount_table: Option<ContainerMountTable>

The guest’s container mount table, which Detcore renders as every spelling of /proc/<pid>/mountinfo and /proc/<pid>/mounts on every backend (crate::container_mounts, https://github.com/rrnewton/hermit/issues/4213). hermit-cli builds it once, in the completed container namespace before the guest starts, or, for --no-namespace and a library caller on KVM that built no container, in the namespace the guest runs in (its launch mounts and base mountpoints); a recording carries it, so its replay renders the recorded table. None (a library caller on a backend other than KVM, whose command may chroot or mount where Hermit cannot see, and every older configuration) leaves both files to the kernel, sanitized as before. Runtime provenance, not a user option.

§sequentialize_threads: bool

Sequentialize thread execution deterministically.

§runs_post_fork: RunsPostFork

Choose which side of an ordinary fork/clone runs first after the child is registered. Random choices are deterministic under --sched-seed.

§passthru_opt: bool

Use the optimized partial syscall subscription set instead of intercepting every syscall. This permits unlisted syscalls to bypass Detcore and therefore weakens deterministic accounting; leave it disabled for fail-closed execution.

§imprecise_timers: bool

In chaos mode, uses much cheaper approximate preemption timers. Only makes sense when recording preemptions for later (precise) replay.

§signal_state_copy: bool

Turn off Detcore’s own copy of each guest thread’s signal dispositions and masks (A5, docs/SIGNAL_STATE_CHECK.md). The copy is on by default where it can run (ptrace with serialized threads): it is checked against the kernel, and decisions A5 converted read it in place of the kernel’s /proc view. With it off, those decisions read /proc, and no handler return is reported. A recorded schedule states the setting it ran under, and replaying it under the other setting is refused.

§signal_delivery_check_fatal: bool

Whether a signal delivery that the kernel contradicts, where Detcore’s copy and the kernel are both certain (A5 step 3.2), ends the run as an internal failure (HERMIT_INTERNAL_FAILURE class=signal-delivery-check) rather than being logged as a divergence that drops the copy. It is a Detcore defect either way. hermit run --strict sets it; nothing else does, and it changes nothing while the copy matches the kernel.

The host sets it. It has no legacy key: to_legacy_backend_json leaves it out and from_legacy_backend_json reads it back as false.

§chaos: bool

Schedule threads chaotically.

The behavior of this flag is subject to change. Current behavior is to randomize thread priorities at every logical timeslice. Other randomization strategies are possible with --sched-heuristic.

Thread scheduling remains deterministic, determined by the random seed.

§fuzz_futexes: bool

Uses the --fuzz-seed to generate randomness and fuzz nondeterminism in the futex semantics.

§chaos_target_races: bool

Targeted chaos: bias scheduling toward known concurrency race patterns instead of exploring interleavings uniformly. At the scheduler’s existing nondeterminism points it uses --fuzz-seed to (a) deliver a process-directed signal to a randomly chosen thread in the group (signal timing races) and (b) randomize the requeue position of a force-unblocked thread (lock-ordering / wakeup races). Only takes effect with --chaos; like the rest of chaos mode it remains reproducible under a fixed seed.

§chaos_per_thread_slowdown: bool

Reproducible per-thread slowdown factors for chaos mode. A factor greater than one makes each RCB consume proportionally more virtual time, while a factor below one makes it consume less. Thus scheduling deadlines and the guest-visible virtual clock describe the same slowed execution rather than applying an out-of-band scheduling bias. The factor is a pure function of scheduler seed, stable deterministic thread id, and chaos epoch. A fixed seed therefore reproduces both timing and interleavings.

§chaos_slowdown_max_factor: f64

Maximum ratio between the slowest and fastest per-thread slowdown factor for --chaos-per-thread-slowdown. Each thread’s factor is drawn log-uniformly from [1/R, R] where R is this value. Must fit the Q32 virtual-time representation and be >= 1.0; 1.0 disables the spread.

§chaos_epoch_length_ns: u64

Length of a deterministic slowdown epoch in elapsed per-thread logical nanoseconds. At the first scheduler commit at or after each boundary the factor is redrawn as factor(seed, stable_dettid, epoch). This is never wall time. 0 means one epoch for the entire run, making constant slowdown the single-epoch special case. Recorded preemption artifacts carry exact epoch transitions and factors for replay. Inert without chaos slowdown.

§record_preemptions: bool

Record the timing of preemption events for future replay or experimentation. This is only useful in chaos modes.

§record_preemptions_to: Option<PathBuf>

File to write the record of preemptions (in JSON). Implies --record-preemptions.

§replay_preemptions_from: Option<PathBuf>

JSON file to read recorded preemptions from. When --chaos mode is activated, these recorded preemption points take the place of randomized scheduling decisions.

§replay_schedule_from: Option<PathBuf>

File to read recorded schedule trace from. This execution will replay the schedule verbatim from the file.

§replay_exhausted_panic: bool

If we run out of events while replaying a schedule, treat that as a fatal event and panic, rather than continuing execution.

§die_on_desync: bool

When playing a schedule trace from disk, bail out on the first time we desynchronize from the event sequence specified in the trace.

§stacktrace_event: Vec<(u64, Option<PathBuf>)>

Given schedule events traced on recording or replaying, print the stack trace at the moment after the Nth event in the trace. Optionally, provide an output file into which the stack trace will be printed, otherwise it goes to stderr.

§stacktrace_signal: Option<SigWrapper>

Internal feature used to signal the guest with SIGINT at every --stacktrace-event, this is in-lieu of using hermit’s internal stacktrace printing facility, to instead have an external debugger handle it. Accepts either signal names or numbers.

§preemption_stacktrace: bool

Deprecated: Print a stacktrace each time the program is preempted. Only makes sense in --chaos mode and typically goes with preemption recording/replaying.

§preemption_stacktrace_log_file: Option<PathBuf>

File to write preemption stacktraces to. Implies --preemption-stacktrace. If a log file is not specified, preemption stacktraces are printed to stderr by default.

§deterministic_io: bool

Enable deterministic IO by reassuring we always read/write the maximum possible bytes from IO syscalls. There might be cases that read/write syscalls return less bytes than requests. Detcore, makes an effort to request additional bytes until we reach the ones requested or EOF.

§panic_on_unsupported_syscalls: bool

Fail immediately on unsupported syscalls instead of forwarding them. Ordinary hermit run enables this policy; compatibility requires the explicit --allow-unsupported-syscalls opt-out.

§exit_on_unsupported_syscall: bool

Return a typed Tool error instead of unwinding through a backend callback.

§shutdown_on_unsupported_syscall: bool

Terminate the whole tracer when an unsupported syscall is observed.

§unsupported_syscall_report_fd: Option<i32>

Internal inherited file descriptor used to aggregate unsupported syscalls.

§panic_on_rcb_overshoot: bool

Panic when a precise PMU timer overshoots its expected RCB target instead of logging an error and continuing through normal timer handling. Intended for Detcore debugging.

§has_uts_namespace: bool

Internal: Set to true if we’re inside a UTS namespace.

§replay_data: Option<PathBuf>

Internal: Path to the replay data folder.

§kill_daemons: bool

Kill all remaining tasks iff daemons are the only ones left. Disabled by default.

§gdbserver: bool

Start gdbserver on gdbserver_port for remote debugging Disabled by default.

§gdbserver_port: u16

port gdbserver listening on

§max_timeslice: Option<NonZero<u64>>

Configure the maximum time a guest thread may run without returning to Detcore. This is measured in virtual nanoseconds and enforced with retired conditional branch (RCB) counting. --preemption-timeout is retained as a deprecated alias.

Set this to disabled or 0 to disable PMU-backed preemption. Positive values must be at least one RCB (10 virtual nanoseconds at the default clock multiplier) and require user-space hardware performance counters.

§target_timeslice: Option<NonZero<u64>>

Target logical timeslice, in virtual nanoseconds, checked at syscall boundaries and the other points where the guest returns control to Detcore: signals, timer events, and trapped rdtsc and cpuid instructions unless --target-timeslice-syscalls-only is given. This avoids PMU preemption for workloads that enter the kernel frequently. Omit this option to use only --max-timeslice.

§target_timeslice_syscalls_only: bool

Do not end an expired --target-timeslice at a trapped rdtsc or cpuid while a PMU maximum (--max-timeslice) is armed; end it at the next syscall, signal or timer event, or at the PMU maximum. A trapped instruction can sit inside a user-space spinlock: QEMU’s multi-threaded TCG reads the host TSC while holding its vm_clock_lock, and a vCPU that yields there leaves the other vCPUs spinning for whole PMU slices. Has no effect without --target-timeslice, or with --max-timeslice disabled, where the trap is the only way out of a busy-wait on the TSC.

§futex_wake_yields: bool

After a FUTEX_WAKE or FUTEX_WAKE_BITSET that woke at least one waiter, move the waker to the back of its priority band and have it yield, so that woken threads of its priority run before it continues. Without it, a thread that releases a contended lock keeps running until its slice ends and can re-take the lock many times before the waiter is scheduled: QEMU’s multi-threaded TCG vCPUs starve its main loop of the big QEMU lock this way. The yield is a scheduler turn of its own: the waker’s timeslice keeps its deadlines. Each extra thread switch is charged scheduler time that the guest can observe (see --scheduler-turn-cost), and costs wall time: a two-vCPU QEMU boot took 5% to 48% longer with it. The waker keeps its priority, so a woken thread of a lower priority still runs after it; --chaos redraws threads’ priorities from their chaos PRNG, which can put a woken thread in a lower band; and a random --sched-heuristic does not select first in, first out. In those cases a woken thread is not guaranteed to run first. Applies to the precise futex mode while threads are sequentialized, on the ptrace backend (including e9patch preprocessing, which runs on it); replay applies it as the recorded run did.

§pipe_wake_latency: Option<u64>

Hand the turn to a thread polling a pipe or FIFO once another thread’s action has readied it (https://github.com/rrnewton/hermit/issues/4380), within this many virtual nanoseconds of the acting thread’s own time. A write that moves bytes into a scheduler-managed pipe, a read that makes room in one, an explicit close of one end, or an open of a FIFO end readies the threads polling for that: the scheduler restores their priority, and once the acting thread’s time is this far past its first readying action, at the next point where it returns to Detcore (a syscall’s entry or exit, or a signal or trapped instruction), it is moved behind them and yields, so they run before it continues. A poller is restored to its own priority and the acting thread moves only within its band, so where --chaos has drawn a poller a lower priority than the acting thread, that poller still runs after it and is not guaranteed to run first. 0 hands off at the end of the readying syscall. Unset (the default), nothing changes: a polled thread whose peer is ready waits for the acting thread’s slice to end, as before. Each hand-off adds at least two charged scheduler turns that the guest can observe as time (see --scheduler-turn-cost). A thread that computes after its write without returning to Detcore delays the hand-off until it next does, or its slice ends; an implicit close (an exit, an O_CLOEXEC exec) readies nothing; and an end reopened by path (/proc/self/fd/N, as /dev/fd/N process substitution does) is a channel of its own, so the other side’s actions do not ready it. Recorded schedules store the value, and a replay under another value is refused. Refused without sequentialized threads, on the DBT, KVM and LiteInst backends, with --namespace-only, --strace-only or --debug-externalize-sockets, and under a --sched-heuristic that does not select by priority; never applied in record mode.

§scheduler_turn_cost: Option<NonZero<u64>>

Virtual nanoseconds that each committed scheduler turn adds to the global clock, before --clock-multiplier (default 500000). The charge keeps time moving while threads take turns without running. Every thread observes it as a jump in time across a thread switch, so a guest that times short intervals while another thread runs, such as a QEMU guest kernel calibrating its TSC against the emulated PIT, can see a gap far larger than any work done. A smaller charge makes those jumps smaller; a finite poll or futex timeout then takes more turns to expire. The charge, after the multiplier, must be between 1 and 1000000000. If a charged turn would pass the end of representable virtual time, the run stops with HERMIT_VIRTUAL_CLOCK_EXHAUSTED and exit status 125.

§sigint_instakill: bool

Shut down immediately upon SIGINT, rather than letting the guest handle it.

§warn_non_zero_binds: bool

Warn if binds are non-zero.

§sched_heuristic: SchedHeuristic

Apply a specialized scheduling heuristic which may help exercise certain bugs.

§sched_seed: Option<u64>

Use this number to seed the PRNG that supplies randomness to the scheduler.

§network_trace: NetworkTraceConfig

External network record or replay, set by hermit run --record-networking or --replay-networking; Off otherwise, in which case Detcore never consults it. Its perturbation seed has no fallback to seed or sched_seed.

§sched_sticky_random_param: f64

Configure the probability for the Sticky Random scheduler to stay in a thread. For value 0.0, we are behaving like Random. For value 1.0, we are behaving like a DFS, where the same thread is always picked as long as it is available in the Run queue. After this thread is exhausted, the next thread will be chosen randomly. For value 0.5, we have a 50/50 chance to pick the same thread.

§recordreplay_modes: bool

Internal: An internal flag for indicating to Detcore whether we are in hermit record or hermit replay mode. This is necessary because there are DIFFERENT global invariants in record mode (e.g. files dont exist). If we move to a chroot model and reproduce more, recording less, then this flag should become obsolete.

§replaying: bool

Internal: Set only by hermit replay, alongside recordreplay_modes. Replay serves socket reads, writes, accepts and connects, and poll, ppoll, select and pselect6, from the recording, so they cannot block. They still run as backgrounded blocking I/O, as during recording, but Detcore’s scheduler commits no other turn until they finish. Otherwise the descriptor-table changes of different threads could interleave differently from one replay to the next.

It never enters the legacy form (to_legacy_backend_json), so the DBT runtime’s HERMIT_DBT_DETCONFIG in the guest’s environment is unchanged by its introduction and reads it as false. Record and replay run only on the ptrace backend.

§stop_after_turn: Option<u64>

Internal: debugging option to stop execution after a specific scheduler commit, aka turn number (non-negative integer). This only makes sense if --sequentialize-threads is specified, as the scheduler is otherwise not engaged.

§stop_after_iter: Option<u64>

Internal: debugging option to stop execution after a scheduler loop iteration (non-negative integer). This only makes sense if --sequentialize-threads is specified, as the scheduler is otherwise not engaged.

§debug_externalize_sockets: bool

Internal: Debugging option to treat all sockets as mysterious external, nondeterministic entities, rather than container-internal and determinstically scheduled.

§debug_futex_mode: BlockingMode

Internal: Debugging option to change how futexes are implemented, either precisely modeled by hermit, by polling the kernel with non-blocking futex operations, or treated as external (nondeterministic) operations which unblock at imprecise times.

§no_rcb_time: bool

Do not count the retired conditional branches (RCBs) of each thread towards its logical time. Instead, count each checkin with the scheduler as a fixed increment to logical time. Even when this option is set, HW RCB performance counters may still be enabled if a max-timeslice is specified.

§detlog_heap: bool

An option to enable logging the hash of heap memory maps for the purpose of determinism checking

§detlog_stack: bool

An option to enable logging the hash of stack memory maps for the purpose of determinism checking

THIS HASH COVERS argv AND THE ENVIRONMENT, which the kernel places at the top of the initial process stack. Two runs whose command lines differ by a single character therefore produce different stack hashes from the first sample, even when the command lines are the same LENGTH and every stack address matches. Measured: equal-length-but-different argv diverged the hash 14 records in, while byte-identical argv held it for 5023 records.

Holding a run-directory name to a fixed WIDTH is a sufficient control when only addresses matter, and is NOT sufficient here. Comparing two runs under this flag requires byte-identical argv and environment; otherwise the first divergence you find is your own input.

§detlog_regs: bool

Log a hash of the guest REGISTER FILE at guest-logical-control points, for determinism checking. stdout, the INFO log, the stack and the heap are all hashed today; the register file is not, so two backends can differ in register state and every existing check still reports parity.

SAMPLED ONLY AT GUEST-LOGICAL-CONTROL POINTS – see Detcore::detlog_registers. Registers are NOT sampled inside a tool handler: a backend running its handler in-guest executes code the ptrace reference never executes, so a difference there is correct behaviour, not a determinism bug.

§detlog_io_buffers: bool

Log a hash of each syscall’s OUTPUT BUFFER, taken at the syscall boundary from the address and length in the syscall’s own arguments.

WHAT IT SEES THAT THE MAPPING HASHES DO NOT. --detlog-heap and --detlog-stack hash a whole named mapping, so their coverage is decided by where the guest happened to ALLOCATE a buffer. Measured, three runs per cell, same netlink exchange with only the receive buffer’s home changed: a [stack] buffer is missed by --detlog-heap, a [heap] buffer is missed by --detlog-stack, and a BSS/static or anonymous-mmap buffer is missed by BOTH even with both enabled. Anonymous mmap is where glibc puts any malloc above the 128 KiB M_MMAP_THRESHOLD. Reading the extent out of the syscall arguments makes the buffer’s home irrelevant.

WHY IT IS NOT REDUNDANT WITH --verify. A syscall whose buffer is a bare pointer in Reverie prints the ADDRESS, not the contents, so a recvmsg returning a stable Ok(1468) whose payload varies produces a character-identical record and --verify reports bitwise_parity: true. 44.1% of the syscalls in a QEMU/Linux boot move bytes through such a buffer.

COST is proportional to bytes actually moved, NOT to syscall count or mapping size: ~0.75 s per GB of guest I/O. A QEMU/Linux boot moves 139.1 MB through these buffers, against the 10.9 TB --detlog-heap hashes over the same run.

NAME IS PROVISIONAL: io-buffers is the owner’s candidate and is not settled.

ON BY DEFAULT. It was opt-in until 2026-08-24, and opt-in made the determinism gate weaker than its name: with the hash absent, the netlink recvmsg above compares equal and --verify reports success. A check that must be requested is not a standard. The opt-out exists for the deliberate case (bulk I/O where the cost matters and content parity is not the question), not as the ordinary setting.

COST OF THE DEFAULT, measured 2026-08-24 on a 316-core x86_64 Linux build host: a typical small test guest pays about ONE MILLISECOND (/bin/true 0.029s -> 0.030s, /bin/ls 0.041s -> 0.041s, 8 runs each). 64 MiB through cat costs +0.07-0.10s in a RELEASE build, which is the ~1.1-1.6 s/GB matching the figure quoted above. The same workload in a DEBUG build costs +3.4s, roughly 50x more, because the hash loop is unoptimized – so a debug-built node moving tens of megabytes is the one place the default is felt.

§detlog_regs_cadence: u64

Sampling cadence for --detlog-regs: hash every Nth guest-logical-control point.

COST TIER. 1 (the default) is the FULL tier – every control point hashed – and is what a short test should use. Measured cost at this scale is within run-to-run noise: /bin/true (49 control points), wc -l /etc/passwd (135) and a 5-iteration shell loop (195) were 0.04-0.07s with the flag on and the same with it off. A larger N is the SPOT-CHECK tier for runs where full hashing is too expensive; it trades detection latency for cost, since a divergence is only seen at the next sampled point. Every emitted line records the tier it was produced under, so a cell can state which tier it met instead of leaving it implicit.

§sysinfo_uptime_offset: u64

Configure a time offset (in seconds) between a container OS considered booted and a guest is executed This primarily affects ‘sysinfo’ syscall’s ‘uptime’ field reporting

§memory: u64

Configure memory available for the container. Takes a number of bytes, or shorthand (e.g. “1GB”). Right now this doesn’t enforce an upper bound, but does affect the amount of memory reported to the guest.

§proc_level: ProcLevel

How much of /proc the guest sees. Every level is the same on every backend and host. minimal (the default) shows a small set, modelled on gVisor’s; standard shows every system-wide name Detcore serves or plans to serve. A system-wide or /proc/sys name outside the chosen level does not exist: lookups give ENOENT and listings leave it out. So does a name in a process’s or a thread’s directory, except a few that Hermit still leaves to the kernel (mem, uid_map, gid_map, setgroups), as are whether a process exists and the entries of its fd, fdinfo, ns and net. A spelling through a symbolic link or .. is checked only when it opens a file.

§interrupt_at: Vec<(DetPid, u64)>

Configure extra interrupt points based on thread id and rcb counter. Detcore will raise a precise timer for this RCB whenever it detects that current current thread timeslice intercects any of the interrupt points specified

§happens_before: Option<HappensBeforeProgram>

Resolved happens-before program: deterministic ordering edges between anchored events (see detcore_model::happens_before). This is populated programmatically by hermit-cli after loading and resolving a --happens-before spec against the guest binary; it is not a direct CLI flag and is not serialized (it is reconstructed from the spec file each run, so #[serde(skip)] avoids requiring serde on Sysno-bearing positions and keeps save-config output stable). The scheduler enforces these edges only when sequentialize_threads is set.

§record_host_inputs: bool

Whether Detcore records the host identity of each file the guest opens, sending each record to the global state, which writes the run’s records to Self::host_input_log when the run ends (see crate::host_input). hermit run --verify sets it, so that a divergence caused by a host file replaced during a run can be named. The records are never part of the compared log. Serialized, so that it reaches the Detcore tool on every backend, including one that runs inside the guest and receives this Config over RPC; never a CLI flag.

§host_input_log: Option<PathBuf>

Where the global state writes the run’s host-input records, one crate::host_input::HostInputRecord JSON line each and a crate::host_input::HostInputLogEnd line, when the run ends. hermit run --verify sets a private file. A host path, read only by the global state, which every backend that hosts it builds from this Config in-process; so set programmatically, like happens_before, and never serialized.

§untraced_code_range: Option<(u64, u64)>

A guest address range, [start, end), holding code whose syscalls the backend lets through without Detcore seeing them, which the guest cannot otherwise use without faulting. With Self::record_host_inputs set, a guest call that may change the memory there (a fixed mapping over it, a protection or advice change or unmapping that covers it, an open of a process-memory file for writing) is reported as a change at /, so no host input change is named in that run (see crate::host_input). The backend that hosts Detcore in-process sets it, so set programmatically, like happens_before, and never serialized.

§fatal_core_capture: Option<FatalCoreCapture>

Opt-in capture of a core file for a guest thread killed by a signal whose default action dumps core; None, the default, writes nothing. A host path and host-side limits, read only by the global state at a fatal exit stop, so set programmatically, like host_input_log, and never serialized.

Implementations§

Source§

impl Config

Source

pub fn with_backend( self, change: impl FnOnce(&mut BackendCapabilities), ) -> Config

This configuration with change applied to its backend capabilities. BackendCapabilities cannot be built field by field outside Reverie, so a caller that needs to adjust individual facts starts from the value already here.

Source

pub fn has_default_epoch(&self) -> bool

Whether the epoch is the stable library default omitted by Display.

Source

pub fn capture_epoch_from_host_time(&mut self, now: SystemTime)

Replace the stable library/test default with the host wall clock captured by the outer hermit run invocation. The caller owns the single host-clock read boundary; all guest clock and metadata observations consume the resulting concrete epoch.

Source

pub fn minimum_max_timeslice_nanos(&self) -> u64

Smallest PMU-backed maximum representable by one RCB at this clock multiplier.

Source

pub fn validate_invariants(&self)

Check invariants that must hold at every execution boundary without mutating the config.

Source

pub fn validate(&mut self)

Sanity check the flags, and update any wherever flag B is implied by A.

Source

pub fn use_preemption_timer(&self) -> bool

Whether configured preemption can use this backend’s timer mechanism.

This is independent of RCB accounting and does not certify a clock.

Source

pub fn use_rcb_time(&self) -> bool

Should we use RCB in computing logical time?

The answer is NO either if --no-rcb-time is specified or if HW counters are disabled by setting --max-timeslice=disabled.

Source

pub fn yields_after_futex_wake(&self, woken: u64) -> bool

Whether a FUTEX_WAKE that woke woken waiters makes the waker yield to them (--futex-wake-yields).

A thread that releases a contended lock usually keeps running: the waiter it woke is queued behind it, and the waker can re-take the lock, uncontended, many times before that waiter runs. glibc and Rust mutexes both let a releasing thread barge back in, and on real hardware the woken thread wins on another CPU within the release window. Under sequentialized threads it never gets one, so QEMU’s multi-threaded TCG vCPUs starved its main loop of the big QEMU lock for whole PMU slices at a time (https://github.com/rrnewton/hermit/issues/3874). When this holds, the scheduler moves the waker to the back of its priority band, and the waker takes a yield turn at the syscall’s post-hook, so woken threads of its priority run before it continues (it keeps its band; --chaos can redraw priorities, and a random heuristic does not select first in, first out). The yield leaves the waker’s timeslice alone.

A thread switch is not free in virtual time: every scheduler decision is charged, so a policy that switches more often moves time that the guest observes. A QEMU guest kernel that calibrates its TSC against the emulated PIT failed that calibration with this policy, because the main loop now ran in the middle of it.

The decision reads only the configuration and the wake’s result, the number of waiters the scheduler took off the futex in the waker’s turn, which is already deterministic. A wake that woke no one keeps the slice. Replay applies the policy exactly as the recorded run did: a preemption record holds slice ends but not this queue order, so the requeue and the yield must happen again for the replayed run to reach the same schedule. Because the yield consumes no slice end and draws nothing from the thread’s chaos PRNG, making it again keeps the replay aligned with its record.

Source

pub fn scheduler_turn_charge(&self) -> Result<u64, String>

The virtual nanoseconds each committed scheduler turn adds to the global clock: --scheduler-turn-cost (default NANOS_PER_SCHED) times --clock-multiplier, truncated as it always was. A configured cost must give a charge of at least one nanosecond, because the charge is what advances the clock through turns that run no guest code, such as the retries of a finite poll; a scaled charge of zero would leave such a timeout unable to expire. A configured cost, or its scaled charge, above MAX_SCHEDULER_TURN_COST is refused too, so that a configured charge never exceeds one second per turn.

Source

pub fn pipe_wake_latency_in_effect(&self) -> Option<u64>

The --pipe-wake-latency in effect (https://github.com/rrnewton/hermit/issues/4380): the option’s value in run mode, with sequentialized threads and a heuristic that selects by priority; None everywhere else, so nothing of the hand-off runs.

Source

pub fn use_nonblocking_sockets(&self) -> bool

Should we convert sockets to SOCK_NONBLOCK?

Source

pub fn should_trace_schedevent(&self) -> bool

Should we call trace_schedevent to trace each SchedEvent? This applies to both record and replay for scheduled events.

Source

pub fn interrupts_for_thread(&self, thread_id: DetPid) -> BTreeSet<u64>

Returns manual interuption points for a given thread

Source§

impl Config

Source

pub fn from_env() -> Config

Construct the config using environment variables only, not CLI args.

Source

pub fn rng_seed(&self) -> u64

Returns effective “rng-seed” parameter taking in account “seed” parameter if former isn’t specified

Source

pub fn fuzz_seed(&self) -> u64

Returns the fuzz_seed, as specified by the user or defaulting to the primary seed if unspecified.

Source

pub fn sched_seed(&self) -> u64

Returns effective “sched-seed” parameter taking in account “seed” parameter if former isn’t specified

Trait Implementations§

Source§

impl Args for Config

Source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
Source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

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 CommandFactory for Config

Source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
Source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
Source§

impl Debug for Config

Source§

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

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

impl Default for Config

Source§

fn default() -> Config

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Config

Source§

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

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

impl Display for Config

Source§

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

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

impl FromArgMatches for Config

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Config, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Config, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Parser for Config

Source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
Source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
Source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
Source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
Source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error. Read more
Source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.
Source§

impl Serialize for Config

Source§

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

Serialize this value into the given Serde serializer. Read more

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> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

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

Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Paint for T
where T: ?Sized,

Source§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
Source§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
Source§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
Source§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
Source§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
Source§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
Source§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
Source§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
Source§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
Source§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
Source§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
Source§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
Source§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
Source§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
Source§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
Source§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
Source§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
Source§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
Source§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
Source§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
Source§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
Source§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
Source§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
Source§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
Source§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
Source§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
Source§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
Source§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
Source§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
Source§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
Source§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
Source§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
Source§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
Source§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
Source§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
Source§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
Source§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
Source§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
Source§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
Source§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
Source§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling Attribute value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
Source§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
Source§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
Source§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
Source§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
Source§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
Source§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
Source§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
Source§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi Quirk value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
Source§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
Source§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
Source§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
Source§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1:

renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
Source§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
Source§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
Source§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
Source§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the Condition value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new Painted with a default Style. Read more
Source§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more