pub struct Resolver<T: HttpTransport + ?Sized> { /* private fields */ }Expand description
A URN resolver over an injected HttpTransport. The ladder plan and verified
results are cached per instance.
Implementations§
Source§impl<T: HttpTransport> Resolver<T>
impl<T: HttpTransport> Resolver<T>
Sourcepub fn with_options(transport: T, options: ResolveOptions) -> Self
pub fn with_options(transport: T, options: ResolveOptions) -> Self
Build a resolver with explicit options.
Source§impl<T: HttpTransport + ?Sized> Resolver<T>
impl<T: HttpTransport + ?Sized> Resolver<T>
Sourcepub fn connect_url(&self) -> &str
pub fn connect_url(&self) -> &str
The connect-CTA URL for the unreachable page.
Sourcepub async fn resolve(&self, urn: &str) -> Result<ResolveOutcome>
pub async fn resolve(&self, urn: &str) -> Result<ResolveOutcome>
Resolve a DIG URN to a typed ResolveOutcome.
A cache layer sits IN FRONT of the network resolve but never weakens
fail-closed: a memory hit is process-trusted (only holds what this process
already verified); a disk hit is RE-VERIFIED against the URN’s root (a
tampered file → IntegrityFailure). Only verified Success bytes are cached.
On a miss it walks the ladder plan, falling through to the next tier on genuine ABSENCE or unreachability but NEVER on an integrity failure:
- a tier’s NOT-FOUND (content absent here) falls through; every tier not-found →
one branded
ResolveError::NotFound(the stranger’s common case: the local node lacks it, the public gateway serves it). - a tier’s TRANSPORT failure falls through; the LAST tier transport-unreachable
→
ResolveOutcome::Unreachable. - a verify/decrypt failure at ANY tier →
ResolveOutcome::IntegrityFailureIMMEDIATELY, aborting the whole ladder (never cascaded/masked/retried — a tampered tier must not become a silent retry on another, §5.4 fail-closed). - a malformed URN / reachable rpc protocol error → a hard
Err.
Sourcepub async fn resolve_rendered(&self, urn: &str) -> Result<ResolvedData>
pub async fn resolve_rendered(&self, urn: &str) -> Result<ResolvedData>
Convenience for the webview/image path: resolve, then RENDER — verified
content for a success, or the appropriate branded text/html page for a
non-success outcome. An integrity failure renders the security page, NEVER
the unverified bytes.