Expand description
The resolution INTERFACE — the UrnResolver trait and its typed outcomes/errors.
This crate defines the CONTRACT, not the transport: a concrete resolver (in dig-urn-resolver,
the node, the browser host) implements UrnResolver over its own I/O, while this module fixes
the shape every implementation shares — the three exhaustive outcomes and the catalogued error
taxonomy — so consumers can depend on one stable interface.
§Three outcomes, deliberately kept distinct
ResolveOutcome::Success— verified, decrypted content.ResolveOutcome::IntegrityFailure— bytes WERE fetched but failed merkle/decrypt verification (tampered / decoy / wrong root). A hard, fail-CLOSED security outcome; the unverified bytes are NEVER carried here.ResolveOutcome::Unreachable— every transport tier was down; nothing was fetched. A friendly, retryable network state.
IntegrityFailure (reached the network, bytes don’t verify — security) and Unreachable
(couldn’t reach the network — retryable) are never conflated. A malformed URN, a not-found
resource, and a reachable protocol error are hard ResolveErrors.
Structs§
- Resolve
Options - Options for a resolve. All optional; a resolver applies its own §5.3-ladder defaults.
- Resolved
Data - The resolved bytes plus their content type. Only ever the VERIFIED content of a
ResolveOutcome::Success.
Enums§
- Resolve
Error - A hard, fail-closed resolution failure. Distinct from
ResolveOutcome::Unreachable(the network-down state) andResolveOutcome::IntegrityFailure(bytes fetched but unverifiable). - Resolve
Outcome - The typed result of a resolve. The three cases are exhaustive and never conflated.
Traits§
- UrnResolver
- The resolution contract: turn a
DigUrninto a typedResolveOutcome.
Type Aliases§
- Result
- Result alias for resolution operations.