Skip to main content

Module telemetry

Module telemetry 

Source
Expand description

telemetry CLI subtree — status / enable / disable / reset.

Backed by rtb_telemetry::consent’s persisted-consent file primitives. The file lives at <ProjectDirs::config_dir()>/<tool>/consent.toml.

§Runtime policy resolution

Per the v0.4 scope addendum §3.2, the runtime CollectionPolicy resolves from this chain (each step short-circuits):

  1. Hardcoded compile-time disable — when the telemetry Cargo feature on rtb is off, the policy is unconditionally Disabled. The subtree is not registered; telemetry status is unreachable from the CLI.
  2. Consent file<config_dir>/<tool>/consent.toml. State enabledEnabled; disabledDisabled; unset or file missing → step 3.
  3. MYTOOL_TELEMETRY env var1 / true / onEnabled; 0 / false / offDisabled; absent → step 4.
  4. DefaultDisabled. Opt-in is the standing rule.

telemetry status reports which step decided the current state.

§Lint exception

linkme::distributed_slice emits #[link_section] which Rust 1.95+ flags under unsafe_code. Allowed at module level — no hand-rolled unsafe blocks anywhere in the module.

Structs§

TelemetryCmd
The telemetry subcommand.