Expand description
The one place that decides whether anonymous usage counting may run, and the token that makes that decision unforgeable.
Every emitting surface calls decide and then, if and only if it gets
TelemetryDecision::Enabled, hands the contained TelemetryConsent to
crate::init. TelemetryConsent has no Default, no public constructor,
and cannot be built from a bool; init takes it by value. That is what
makes the permission decision enforceable by the type system rather than by six init sites
each remembering to re-check the same five-part predicate.
Structs§
- Telemetry
Consent - Proof that a specific machine, at a specific moment, was permitted to collect.
Enums§
- Endpoint
Error - Why an endpoint was refused.
- Telemetry
Decision - The outcome of the emit predicate.
Constants§
- TELEMETRY_
DIR - Directory name under
$CODEWHALE_HOMEthat holds every telemetry file.
Functions§
- decide
- Resolve the emit predicate, reading the Codewhale home from the environment.
- decide_
in_ home - Resolve the emit predicate against an explicit Codewhale home.
- load_
setup_ state_ for_ decision - Load the privacy-bearing setup record for a telemetry decision.
- load_
setup_ state_ for_ decision_ at - Injectable form of
load_setup_state_for_decisionused by every surface and by regression tests. - re_
decide - Re-run the predicate from the filesystem, for the flush path.
- validate_
endpoint - Validate a configured endpoint.