application tier

application-cache

Forge cache module — pluggable cache (Redis/memory/PG). Wraps infrastructure-cache.

Forge cache module — pluggable cache (Redis/memory/PG). Wraps infrastructure-cache.

Tierapplication
Roleunclassified (baselined)
Pathcrates/application/cache
Edition2024
Targetsapplication_cache
Public items19 across 2 modules
Tests5

What it is for

application-cache — pluggable cache. Wraps infrastructure-cache.

B-009 Gate-0.5 finding: infrastructure-cache (crates/infrastructure/cache) ships no migrations/ directory and no CREATE TABLE anywhere in its source. Its Cargo.toml description advertises a Postgres backend, but the crate currently implements only MemoryCache (memory.rs) plus an optional redis feature flag with no bundled implementation file — there is no Postgres-backed variant shipping yet, so no schema exists to vendor. migrations() staying empty is correct for the crate as it stands today; revisit if/when a PgCacheBackend lands upstream.

Capabilities

CacheModule

application-cache — pluggable cache. Wraps infrastructure-cache.

Item
pub struct CacheModule
CacheModule :: fn new() -> Self
CacheModule :: fn name(& self) -> & 'static str
CacheModule :: fn version(& self) -> & 'static str
CacheModule :: fn migrations(& self) -> Vec <MigrationSet>
CacheModule :: async fn migrate_pending(& self, _pool : & PgPool) -> std::result::Result <u32, MigrationError>

services::static_cache (other)

Static-cache render pipeline.

Item
fn path_for_slug(base : & Path, slug : & str) -> PathBuf
fn path_for_post(base : & Path, slug : & str) -> PathBuf
fn path_for_blog_index(base : & Path) -> PathBuf
fn path_for_feed(base : & Path) -> PathBuf
fn path_for_sitemap(base : & Path) -> PathBuf
async fn try_serve_static(base : & Path, slug : & str) -> Option <Response>
async fn try_serve_post(base : & Path, slug : & str) -> Option <Response>
async fn try_serve_feed(base : & Path) -> Option <Response>
async fn try_serve_sitemap(base : & Path) -> Option <Response>

RegenerateAllSummary

Static-cache render pipeline.

Item
pub struct RegenerateAllSummary

RenderError

Static-cache render pipeline.

Item
pub enum RenderError
async fn delete_static(base : & Path, slug : & str) -> Result <(), RenderError>
fn atomic_write(path : & Path, bytes : & u8) -> Result <(), RenderError>

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

application_cache

flowchart TD
  n_application_cache["application_cache"]
  n_application_cache --> n_services["services"]
  n_services --> n_services__static_cache["static_cache"]

Public surface

`crate root`

ItemWhat it is
pub struct CacheModule
CacheModule :: fn new() -> Self
CacheModule :: fn name(& self) -> & 'static str
CacheModule :: fn version(& self) -> & 'static str
CacheModule :: fn migrations(& self) -> Vec <MigrationSet>
CacheModule :: async fn migrate_pending(& self, _pool : & PgPool) -> std::result::Result <u32, MigrationError>

`services::static_cache`

ItemWhat it is
pub enum RenderError
fn path_for_slug(base : & Path, slug : & str) -> PathBufhomeindex.html, anything else → <slug>.html
fn path_for_post(base : & Path, slug : & str) -> PathBuf/post/<slug><base>/post/<slug>.html.
fn path_for_blog_index(base : & Path) -> PathBuf/blog listing index path.
fn path_for_feed(base : & Path) -> PathBuf/blog/feed.xml cached path.
fn path_for_sitemap(base : & Path) -> PathBuf/sitemap.xml cached path.
pub struct RegenerateAllSummaryResult of a regenerate_all run (T2c — populated when handlers are ported)
async fn try_serve_static(base : & Path, slug : & str) -> Option <Response>Try to serve cached HTML for slug
async fn try_serve_post(base : & Path, slug : & str) -> Option <Response>Try to serve <base>/post/<slug>.html.
async fn try_serve_feed(base : & Path) -> Option <Response>Try to serve the cached RSS feed at /blog/feed.xml.
async fn try_serve_sitemap(base : & Path) -> Option <Response>Try to serve the cached sitemap at /sitemap.xml.
async fn delete_static(base : & Path, slug : & str) -> Result <(), RenderError>Remove the static file for slug (idempotent — missing file is fine)
fn atomic_write(path : & Path, bytes : & u8) -> Result <(), RenderError>Atomic write: render to a .tmp file, fsync, rename

No pub use re-exports: every item above is declared in this crate.

Boundary

Reaches into infrastructure.

Shares tier application with 120 other crates: application-agreements, application-ai, application-analytics, application-approvals, application-assessments, application-audit-log, application-auth, application-billing, … (120 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)application
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/application/cache
Vocabulary in force (lexicon)current

Tier flow. Which tiers this crate's own edges cross.

flowchart LR
  n_application["application"] --> n_infrastructure["infrastructure"]

Dependencies

Runtime, in this workspace.

CrateTierOptionalOnly on
`application-core`applicationnoalways
`infrastructure-cache`infrastructurenoalways

Runtime, from outside the workspace.

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

Development. None.

Build. None.

Depended on by. 1 workspace crate.

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

flowchart LR
  n_application_cms["application-cms"] -->|uses| SELF
  SELF["application-cache"]
  SELF -->|runtime| n_application_core["application-core"]
  SELF -->|runtime| n_infrastructure_cache["infrastructure-cache"]
  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
libapplication_cache`src/lib.rs`

Error model

Error typeNamed by
RenderErroratomic_write, delete_static

Operational characteristics

PropertyEvidence
async public surfaceyes
async runtimeyes
database accessyes
network I/Oyes
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
CARGO_PKG_VERSIONsrc/lib.rs

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

Verification

KindCount
Unit tests5
Integration tests0
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root100
services::static_cache1302

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc1219
Public modules with a //! block12
pie showData
    title Public items with rustdoc
    "Documented" : 12
    "No rustdoc detected" : 7

Metrics

MetricValue
Rust source files3
Source lines304
Code lines214
Public API items19
Public modules2
Tests5
Examples0
Cargo features0
Direct runtime dependencies12
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "enum" : 1
    "function" : 11
    "method" : 5
    "struct" : 2
pie showData
    title Rust source composition
    "Code" : 214
    "Blank or comment" : 90

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 application · Manual