Privacy research database for tracking website fingerprinting, behavioral surveillance, and tracker exposure over time
| Tier | domain |
| Role | unclassified (baselined) |
| Path | crates/domain/privacy-research |
| Edition | 2021 |
| Targets | domain_privacy_research |
| Public items | 34 across 5 modules |
| Tests | 5 |
What it is for
This crate does not document itself. No //! block on its entry point. The facts below are complete; the reason this crate exists is not written down anywhere, and belongs in src/lib.rs rather than here.
Capabilities
PrivacyResearchError
_No module-level documentation is present in the source._
| Item |
|---|
pub enum PrivacyResearchError |
RescanAllJob
_No module-level documentation is present in the source._
| Item |
|---|
pub struct RescanAllJob |
ScanBatchJob
_No module-level documentation is present in the source._
| Item |
|---|
pub struct ScanBatchJob |
ScanSiteJob
_No module-level documentation is present in the source._
| Item |
|---|
pub struct ScanSiteJob |
jobs::job_types (other)
_No module-level documentation is present in the source._
| Item |
|---|
pub const SCAN_SITE: & str |
pub const SCAN_BATCH: & str |
pub const RESCAN_ALL: & str |
pub const REFRESH_VIEWS: & str |
FingerprintingTechnique
_No module-level documentation is present in the source._
| Item |
|---|
pub struct FingerprintingTechnique |
LatestScanSummary
_No module-level documentation is present in the source._
| Item |
|---|
pub struct LatestScanSummary |
NewScan
_No module-level documentation is present in the source._
| Item |
|---|
pub struct NewScan |
NewSite
_No module-level documentation is present in the source._
| Item |
|---|
pub struct NewSite |
PrivacyScan
_No module-level documentation is present in the source._
| Item |
|---|
pub struct PrivacyScan |
Site
_No module-level documentation is present in the source._
| Item |
|---|
pub struct Site |
TrackerDomain
_No module-level documentation is present in the source._
| Item |
|---|
pub struct TrackerDomain |
TrackerEntity
_No module-level documentation is present in the source._
| Item |
|---|
pub struct TrackerEntity |
CategoryScore
_No module-level documentation is present in the source._
| Item |
|---|
pub struct CategoryScore |
FanOutStats
_No module-level documentation is present in the source._
| Item |
|---|
pub struct FanOutStats |
PrivacyResearchStore:PrivacyResearchStore
_No module-level documentation is present in the source._
| Item |
|---|
pub struct PrivacyResearchStore |
PrivacyResearchStore:fan
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn fan_out_scan_data(& self, scan_id : Uuid, report : & serde_json::Value,) -> Result <FanOutStats, PrivacyResearchError> |
PrivacyResearchStore:get
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn get_site_by_host(& self, host : & str) -> Result <Option <Site>, PrivacyResearchError> |
PrivacyResearchStore:insert
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn insert_scan(& self, input : & NewScan) -> Result <Uuid, PrivacyResearchError> |
PrivacyResearchStore:list
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn list_sites(& self) -> Result <Vec <Site>, PrivacyResearchError> |
PrivacyResearchStore:most
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn most_common_trackers(& self, limit : i64,) -> Result <Vec <TrackerFrequency>, PrivacyResearchError> |
PrivacyResearchStore :: async fn most_common_fingerprinting(& self, limit : i64,) -> Result <Vec <TechniqueFrequency>, PrivacyResearchError> |
PrivacyResearchStore:new
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: fn new(pool : PgPool) -> Self |
PrivacyResearchStore:refresh
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn refresh_latest_scans(& self) -> Result <(), PrivacyResearchError> |
PrivacyResearchStore:scores
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn scores_by_category(& self) -> Result <Vec <CategoryScore>, PrivacyResearchError> |
PrivacyResearchStore:site
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn site_history(& self, site_id : Uuid, limit : i64,) -> Result <Vec <ScanHistoryEntry>, PrivacyResearchError> |
PrivacyResearchStore:upsert
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn upsert_site(& self, input : & NewSite) -> Result <Site, PrivacyResearchError> |
PrivacyResearchStore:worst
_No module-level documentation is present in the source._
| Item |
|---|
PrivacyResearchStore :: async fn worst_sites(& self, limit : i64,) -> Result <Vec <LatestScanSummary>, PrivacyResearchError> |
ScanHistoryEntry
_No module-level documentation is present in the source._
| Item |
|---|
pub struct ScanHistoryEntry |
TechniqueFrequency
_No module-level documentation is present in the source._
| Item |
|---|
pub struct TechniqueFrequency |
TrackerFrequency
_No module-level documentation is present in the source._
| Item |
|---|
pub struct TrackerFrequency |
How to use it
No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.
Module structure
domain_privacy_research
errorjobsjobs::job_typesmodelsstore
flowchart TD n_domain_privacy_research["domain_privacy_research"] n_domain_privacy_research --> n_error["error"] n_domain_privacy_research --> n_jobs["jobs"] n_jobs --> n_jobs__job_types["job_types"] n_domain_privacy_research --> n_models["models"] n_domain_privacy_research --> n_store["store"]
Public surface
`error`
| Item | What it is |
|---|---|
pub enum PrivacyResearchError | — |
`jobs`
| Item | What it is |
|---|---|
pub struct ScanSiteJob | Job payload for scanning a single site. |
pub struct ScanBatchJob | Job payload for scanning a batch of sites from a list. |
pub struct RescanAllJob | Job payload for rescanning all known sites. |
`jobs::job_types`
| Item | What it is |
|---|---|
pub const SCAN_SITE: & str | — |
pub const SCAN_BATCH: & str | — |
pub const RESCAN_ALL: & str | — |
pub const REFRESH_VIEWS: & str | — |
`models`
| Item | What it is |
|---|---|
pub struct Site | A canonical website identity for privacy research. |
pub struct NewSite | Input for creating a new site. |
pub struct TrackerEntity | A company/organization that tracks users across websites. |
pub struct TrackerDomain | A domain owned by a tracker entity. |
pub struct FingerprintingTechnique | A known fingerprinting technique. |
pub struct PrivacyScan | A single privacy scan run — immutable fact record. |
pub struct NewScan | Input for storing a new scan. |
pub struct LatestScanSummary | Latest scan summary per site (from materialized view). |
`store`
| Item | What it is |
|---|---|
pub struct PrivacyResearchStore | Database operations for privacy research data. |
PrivacyResearchStore :: fn new(pool : PgPool) -> Self | — |
PrivacyResearchStore :: async fn upsert_site(& self, input : & NewSite) -> Result <Site, PrivacyResearchError> | — |
PrivacyResearchStore :: async fn get_site_by_host(& self, host : & str) -> Result <Option <Site>, PrivacyResearchError> | — |
PrivacyResearchStore :: async fn list_sites(& self) -> Result <Vec <Site>, PrivacyResearchError> | — |
PrivacyResearchStore :: async fn insert_scan(& self, input : & NewScan) -> Result <Uuid, PrivacyResearchError> | — |
PrivacyResearchStore :: async fn worst_sites(& self, limit : i64,) -> Result <Vec <LatestScanSummary>, PrivacyResearchError> | Get the worst-scoring sites (latest scan per site). |
PrivacyResearchStore :: async fn site_history(& self, site_id : Uuid, limit : i64,) -> Result <Vec <ScanHistoryEntry>, PrivacyResearchError> | Get privacy score history for a site over time. |
PrivacyResearchStore :: async fn most_common_trackers(& self, limit : i64,) -> Result <Vec <TrackerFrequency>, PrivacyResearchError> | Get most common trackers across all scanned sites. |
PrivacyResearchStore :: async fn most_common_fingerprinting(& self, limit : i64,) -> Result <Vec <TechniqueFrequency>, PrivacyResearchError> | Get most common fingerprinting techniques across sites. |
PrivacyResearchStore :: async fn scores_by_category(& self) -> Result <Vec <CategoryScore>, PrivacyResearchError> | Get average privacy score by site category. |
PrivacyResearchStore :: async fn fan_out_scan_data(& self, scan_id : Uuid, report : & serde_json::Value,) -> Result <FanOutStats, PrivacyResearchError> | Fan out JSONB report data into normalized child tables |
PrivacyResearchStore :: async fn refresh_latest_scans(& self) -> Result <(), PrivacyResearchError> | Refresh the materialized view (call after inserting new scans). |
pub struct FanOutStats | Stats from fan-out normalization. |
pub struct TrackerFrequency | — |
pub struct TechniqueFrequency | — |
pub struct CategoryScore | — |
pub struct ScanHistoryEntry | — |
Re-exports. Exported here, defined elsewhere.
| Export | Defined in |
|---|---|
PrivacyResearchError | error::PrivacyResearchError |
{CategoryScore,PrivacyResearchStore,TechniqueFrequency,TrackerFrequency} | store::{CategoryScore,PrivacyResearchStore,TechniqueFrequency,TrackerFrequency} |
{FingerprintingTechnique,LatestScanSummary,NewScan,NewSite,PrivacyScan,Site,TrackerDomain,TrackerEntity,} | models::{FingerprintingTechnique,LatestScanSummary,NewScan,NewSite,PrivacyScan,Site,TrackerDomain,TrackerEntity,} |
{job_types,RescanAllJob,ScanBatchJob,ScanSiteJob} | jobs::{job_types,RescanAllJob,ScanBatchJob,ScanSiteJob} |
Boundary
Reaches into foundation.
Shares tier domain with 41 other crates: domain-agreements, domain-ai-report, domain-billing, domain-catalog, domain-classify, domain-comments, domain-competitive-intel, domain-contact, … (41 total).
_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._
Where it sits
| Tier (ontology) | domain |
| Architectural role (taxonomy) | unclassified (baselined) |
| Location | crates/domain/privacy-research |
| Vocabulary in force (lexicon) | current |
Tier flow. Which tiers this crate's own edges cross.
flowchart LR n_domain["domain"] --> n_foundation["foundation"]
Dependencies
Runtime, in this workspace.
| Crate | Tier | Optional | Only on |
|---|---|---|---|
| `foundation-basemodels` | foundation | no | always |
Runtime, from outside the workspace.
| Crate | Requirement | Features | Optional | Only on |
|---|---|---|---|---|
chrono | ^0.4 | serde | no | always |
serde | ^1 | derive | no | always |
serde_json | ^1 | — | no | always |
sqlx | ^0.8 | runtime-tokio, postgres, chrono, uuid, json | no | always |
thiserror | ^2 | — | no | always |
tracing | ^0.1 | — | no | always |
uuid | ^1 | v4, v7, serde, js | no | always |
Development. None.
Build. None.
Depended on by. 3 workspace crates.
Signal flow — what reaches this crate, and what it reaches.
flowchart LR n_application_privacy_research["application-privacy-research"] -->|uses| SELF n_operations_privacy_scan_runner["operations-privacy-scan-runner"] -->|uses| SELF n_platform_privacy_scan_api["platform-privacy-scan-api"] -->|uses| SELF SELF["domain-privacy-research"] SELF -->|runtime| n_foundation_basemodels["foundation-basemodels"] classDef self fill:#1f883d,stroke:#1f883d,color:#fff; class SELF self;
Feature flags
No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.
Targets
| Kind | Name | Source |
|---|---|---|
| lib | domain_privacy_research | `src/lib.rs` |
Error model
| Error type | Named by |
|---|---|
PrivacyResearchError | declared, no public signature returns it |
Operational characteristics
| Property | Evidence |
|---|---|
| async public surface | yes |
| async runtime | none detected |
| database access | yes |
| network I/O | none detected |
| unsafe code | none detected |
| environment variables | none detected |
No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.
Configuration
No environment variable is read with a literal name anywhere in this crate. A variable whose key is computed at run time cannot be listed here, and is not claimed to be absent.
Related capabilities
3 workspace crates depend on this one: application-privacy-research, operations-privacy-scan-runner, platform-privacy-scan-api.
Verification
| Kind | Count |
|---|---|
| Unit tests | 5 |
| Integration tests | 0 |
| Examples | 0 |
| Doctests | 0 |
Evidence by module. How often each public module is named by something executable.
| Module | Tests | Examples | Consumers |
|---|---|---|---|
error | 1 | 0 | 0 |
jobs | 3 | 0 | 1 |
jobs::job_types | 4 | 0 | 1 |
models | 8 | 0 | 3 |
store | 6 | 0 | 1 |
What the tests establish, by name:
rescan_all_job_serializes—src/jobs.rsscan_batch_job_serializes—src/jobs.rsscan_site_job_serializes—src/jobs.rsnew_scan_creates—src/models.rsnew_site_creates—src/models.rs
Documentation coverage
| Measure | Documented | Total |
|---|---|---|
| Public items with rustdoc | 20 | 34 |
Public modules with a //! block | 0 | 5 |
pie showData
title Public items with rustdoc
"Documented" : 20
"No rustdoc detected" : 14
Metrics
| Metric | Value |
|---|---|
| Rust source files | 5 |
| Source lines | 942 |
| Code lines | 824 |
| Public API items | 34 |
| Public modules | 5 |
| Tests | 5 |
| Examples | 0 |
| Cargo features | 0 |
| Direct runtime dependencies | 8 |
| Workspace reverse dependencies | 3 |
pie showData
title Public API by kind
"constant" : 4
"enum" : 1
"method" : 12
"struct" : 17
pie showData
title Rust source composition
"Code" : 824
"Blank or comment" : 118
Generation
Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.