infrastructure capa

infrastructure-kv-store

Key-value storage abstraction traits for cross-platform persistence

Key-value storage abstraction traits for cross-platform persistence

Tierinfrastructure
Roleunclassified (baselined)
Pathcrates/infrastructure/kv-store
Edition2021
Targetsinfrastructure_kv_store
Public items0 across 0 modules
Tests9

What it is for

Key-value storage abstraction for cross-platform persistence.

This crate provides traits for key-value storage that can be implemented by different backends (IndexedDB for browser, SQLite for desktop/mobile, in-memory for testing).

# Design Principles

# Example

use infrastructure_kv_store::{KeyValueStore, InMemoryStore};

async fn example() {
let store = InMemoryStore::new();

// Store some data
store.set("user:123", b"alice").await.unwrap();

// Retrieve it
let value = store.get("user:123").await.unwrap();
assert_eq!(value, Some(b"alice".to_vec()));

// List keys with prefix
let keys = store.keys("user:").await.unwrap();
assert_eq!(keys, vec"user:123");
}

Capabilities

No public items.

How to use it

From this crate's own rustdoc:

use infrastructure_kv_store::{KeyValueStore, InMemoryStore};

async fn example() {
    let store = InMemoryStore::new();
    
    // Store some data
    store.set("user:123", b"alice").await.unwrap();
    
    // Retrieve it
    let value = store.get("user:123").await.unwrap();
    assert_eq!(value, Some(b"alice".to_vec()));
    
    // List keys with prefix
    let keys = store.keys("user:").await.unwrap();
    assert_eq!(keys, vec!["user:123"]);
}

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
InMemoryStorememory::InMemoryStore
{KeyValueStore,KeyValueStoreExt}traits::{KeyValueStore,KeyValueStoreExt}
{StorageError,StorageResult}error::{StorageError,StorageResult}

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/kv-store
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
async-trait^0.1noalways
serde^1derivenoalways
serde_json^1noalways
thiserror^2noalways

Development, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
tokio^1full, rt, macrosnoalways

Build. None.

Depended on by. 3 workspace crates.

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

flowchart LR
  n_application_kv_store["application-kv-store"] -->|uses| SELF
  n_infrastructure_kv_store_indexeddb["infrastructure-kv-store-indexeddb"] -->|uses| SELF
  n_platform_wasm_ui["platform-wasm-ui"] -->|uses| SELF
  SELF["infrastructure-kv-store"]
  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_kv_store`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 accessnone detected
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.

3 workspace crates depend on this one: application-kv-store, infrastructure-kv-store-indexeddb, platform-wasm-ui.

Verification

KindCount
Unit tests9
Integration tests0
Examples0
Doctests1

What the tests establish, by name:

Documentation coverage

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

Metrics

MetricValue
Rust source files4
Source lines461
Code lines254
Public API items0
Public modules0
Tests9
Examples0
Cargo features0
Direct runtime dependencies4
Workspace reverse dependencies3
pie showData
    title Rust source composition
    "Code" : 254
    "Blank or comment" : 207

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.

Todas las infrastructure · Manual