Expand description
prov’s peer port — where the other workspaces are.
Target::Foreign is where resolution
stops. It can tell you that a reference names the workspace notes and the
id ajp7eq; it cannot tell you where notes is, and deliberately does not
try, because that map is a property of the device doing the reading rather
than of the archive being read. The same reference resolves to a directory
on one machine, a URL on another, and nothing at all on a third.
This module is the seam between those two halves. It does not hold a map and
never will. It declares the shape a host’s map answers in — the third port
beside fs::ReadStorage and
index::IdIndex, and the smallest of the three.
§Why a port at all, if prov holds no map
Because two things about cross-workspace resolution are prov’s, and before this module both were re-decided per host:
-
What an answer is.
prov-clianswers with a directory on this disk; diaryx answers with a published ARK permalink. Those are one type (PeerLocation), and a consumer that can render either — an export writing anhref, a viewer offering to follow a link — should not need to know which host it is talking to. -
What makes an answer trustworthy. This is the load-bearing half. A peer map is a claim about a name, and a wrong claim does not fail: it resolves to real documents in the wrong archive. That failure mode is the whole reason there is no peer table in
prov.yaml— but it is also fixable, because a prov workspace declares its own name (workspace_id). Comparing the name asked for against the name found is a check only prov can specify, andPeerLookup::confirmis where it happens, so no host decides for itself what “confirmed” means.
§Where this port stops
At an address. Nothing here opens a workspace, and nothing here can: reading
the peer would need a second ReadStorage and a
second IdIndex, which only the host has. So a
resolver hands back where, the host does the opening, and the layering the
rest of this crate keeps — a read core that cannot reach past its own root —
is undisturbed.
That is also why no method on Graph takes a
resolver and why Graph grows no third type parameter. Following a foreign
reference is a second step after resolution, taken by a caller that wants
it, not a deeper mode of the first one. A traversal that never follows one
pays nothing, and the read core’s generics stay two wide.
Structs§
- NoPeers
- No peers — every workspace is somewhere this host cannot see.
Enums§
- Peer
Location - An address a resolver answers with: somewhere on this device, or somewhere on the network.
- Peer
Lookup - What a host knows about where one workspace is — and how sure it is.
- Unconfirmed
- Why a location on record could not be confirmed to be the workspace that was asked for.
Traits§
- Peer
Resolver - A host’s map from a workspace name to where that workspace is.