Skip to main content

teksilo_telemetry/
lib.rs

1// SPDX-License-Identifier: MPL-2.0
2// SPDX-FileCopyrightText: 2026 FernTech
3
4//! `teksilo-telemetry` — privacy-respecting product analytics for Teksilo.
5//!
6//! This crate ships the foundational pieces:
7//!
8//! - [`ConsentStore`] — persisted consent state atop
9//!   [`teksilo_settings::SettingsFile`].
10//! - [`InstallId`] — pseudonymous-mode UUID with 13-month rotation.
11//! - [`TelemetryBundle`] / [`OpenedTelemetry`] — declarative
12//!   configuration following the same pattern as
13//!   [`teksilo_settings::SettingsBundle`].
14//! - [`DynamicReporter`] — runtime mode-switch wrapper holding both
15//!   anonymous-mode and pseudonymous-mode adapters and forwarding to
16//!   the active one.
17//! - [`TelemetryExt`] — convenience accessors for `BuildContext` /
18//!   `EventContext` (`use teksilo_telemetry::TelemetryExt;`).
19//! - In-memory event queue.
20//! - [`StubReporter`] — testing-only adapter that collects events into
21//!   a `Vec`.
22//! - Hand-written framework events in [`generated`].
23//!
24//! Re-exports the pure trait/type surface from `teksilo_core::telemetry`
25//! so apps need only `use teksilo_telemetry::*` to access the full API.
26
27pub mod bundle;
28pub mod consent;
29pub mod dynamic_reporter;
30pub mod ext;
31pub mod generated;
32pub mod install_id;
33pub mod queue;
34pub mod scopes;
35pub mod stub;
36
37pub use bundle::{
38    DataResidencyRegion, OpenedTelemetry, PrivacyPolicy, TelemetryBundle, TelemetryBundleError,
39    TelemetryMode,
40};
41pub use consent::{ConsentFile, ConsentStore, PersistedConsentState};
42pub use dynamic_reporter::DynamicReporter;
43pub use ext::TelemetryExt;
44pub use install_id::{InstallId, InstallIdFile};
45pub use queue::{EventQueue, InMemoryEventQueue, PersistentEventQueue, PersistentQueueError};
46pub use stub::StubReporter;
47
48// Re-exports from teksilo-core so apps need only one `use`.
49pub use teksilo_core::telemetry::{
50    ConsentScope, ConsentState, Event, EventCategory, F64Bucket, IntentSource, OwnedEvent,
51    OwnedProp, OwnedPropValue, Prop, PropValue, RemoteDataExport, RemoteEvent, RemoteValue,
52    TelemetryContext, TelemetryError, UsageReporter,
53};