Skip to main content

Module source_replacement

Module source_replacement 

Source
Expand description

Typed source-replacement model.

A source replacement redirects one supported index source to another supported index source for the duration of one Cabin invocation. The mapping is local config policy — it never enters published package metadata, never affects the resolver for downstream consumers, and only swaps existing source kinds (local filesystem index, sparse-HTTP index).

Public syntax (config-only):

[source-replacement]
"https://example.com/index" = { index-path = "../mirror" }

The parser converts the table into a SourceReplacementSettings collection with stable ordering. Resolution walks the chain once with cycle detection so a misconfigured chain like A -> B -> A surfaces a clear error before the resolver ever opens an index.

Structs§

SourceReplacementEntry
One source-replacement declaration. The orchestration layer folds Vec<SourceReplacementEntry> into a SourceReplacementSettings map keyed by original so duplicates can be rejected deterministically.
SourceReplacementResolution
Result of walking the replacement chain.
SourceReplacementSettings
Collection of source-replacement entries plus typed resolution / cycle detection.

Enums§

SourceLocator
Stable, typed identifier for one supported source/index.
SourceReplacementError
Errors produced while parsing / resolving source replacements. Wording is stable so integration tests can match substrings.