Skip to main content

Module doc_format

Module doc_format 

Source
Expand description

Resolving a document format: the tenant’s row, or the bundle’s default.

Two tiers answer “which app owns this content type, and how is it indexed”: the tenant’s own doc_formats row, and the in-memory crate::bundled_apps::BundledAppRegistry this build loaded from dist.

The tenant row always wins, whatever version either side states. A row means the tenant deliberately installed something — usually a packaged app whose code lives in a blob — so a backend upgrade shipping a newer bundled manifest must never silently repoint it. Dropping the row (DELETE /api/doc-formats/{content_type}) reverts to the bundled entry; there is no way to suppress a bundled format outright, only to override it.

Every reader goes through here so the two tiers cannot drift apart. The writer deliberately does not: put_doc_format’s claim check reads the tenant row alone, because a bundled manifest is a default rather than a claim.

Structs§

DocFormatCache
Resolved formats, keyed by (tn_id, content_type).

Enums§

Source
Which tier a resolved format came from.

Functions§

invalidate
Drop one (tn_id, content_type) entry. Call after every successful write to doc_formats, or a PUT does not take effect until restart.
new_doc_format_cache
Build an empty DocFormatCache, so the server crate can register one without taking lru/parking_lot dependencies of its own.
resolve
The format that governs content_type for this tenant, if any.
resolve_list
Every format in effect for this tenant: its own rows, plus each bundled entry no row overrides.