infrastructure tier

infrastructure-preferences

Generic preferences storage with scope/namespace/key design

Generic preferences storage with scope/namespace/key design

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/preferences
Edition2021
Targetsinfrastructure_preferences
Public items0 across 0 modules
Tests8

What it is for

infrastructure-preferences: Generic preferences storage

Overview

This crate provides a preferences storage system with scope/namespace/key design. Preferences are stored in Postgres with JSONB values for flexibility.

Key Types

Example

use infrastructure_preferences::{PreferenceKey, PreferencesService};

let service = PreferencesService::new(pool);
let key = PreferenceKey::user(user_id, "support-web", "theme");

// Set a preference
service.set(&key, &"dark").await?;

// Get a preference
let theme: Option<String> = service.get(&key).await?;

// Get with default
let theme: String = service.get_or_default(&key).await?;

Capabilities

No public items.

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

No public modules: the crate root is its whole surface.

Public surface

No public items.

Re-exports. Exported here, defined elsewhere.

ExportDefined in
PreferencesServiceservice::PreferencesService
{PreferenceKey,PreferenceScope}models::{PreferenceKey,PreferenceScope}
{PreferencesError,PreferencesResult}error::{PreferencesError,PreferencesResult}

Boundary

Depends on no other workspace tier.

Shares tier infrastructure with 82 other crates: infrastructure-acquire, infrastructure-adapters-google-calendar, infrastructure-adapters-google-gmail, infrastructure-adapters-google-places, infrastructure-adapters-google-trends, infrastructure-adapters-shodan, infrastructure-adapters-yelp, infrastructure-agent, … (82 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)infrastructure
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/infrastructure/preferences
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
chrono^0.4serdenoalways
serde^1derivenoalways
serde_json^1noalways
sqlx^0.8runtime-tokio, postgres, chrono, uuid, jsonnoalways
thiserror^2noalways
uuid^1v4, v7, serde, jsnoalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1full, rt-multi-thread, macrosnoalways

Build. None.

Depended on by. 1 workspace crate.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_application_preferences["application-preferences"] -->|uses| SELF
  SELF["infrastructure-preferences"]
  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

KindNameSource
libinfrastructure_preferences`src/lib.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessyes
network I/Onone detected
unsafe codenone detected
environment variablesnone 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.

1 workspace crate depends on this one: application-preferences.

Verification

KindCount
Unit tests8
Integration tests0
Examples0
Doctests0

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc00
Public modules with a //! block00

Metrics

MetricValue
Rust source files4
Source lines328
Code lines202
Public API items0
Public modules0
Tests8
Examples0
Cargo features0
Direct runtime dependencies7
Workspace reverse dependencies1
pie showData
    title Rust source composition
    "Code" : 202
    "Blank or comment" : 126

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.

All infrastructure · Manual