Skip to main content

apply

Function apply 

Source
pub fn apply<S: Store + ?Sized>(
    store: &S,
    host: &str,
    fetch: &Fetch,
    now: &str,
) -> Result<Applied, ListingError>
Expand description

Applies a fetch of host at now (an instant) to the store (L3, L8, the re-review’s N1, N3, N4):

  • Fetch::Fetched: each name of names whose descriptor hashes to its fn_hash is put, with the subjects it has and, in a cut run, those it held (N4: a cut keeps what a name was in); a name the store refuses (its bounds, or another source’s entry of the name, Invalid) is refused, and the run goes on. The subjects this run may create here are at most MAX_CREATED_SUBJECTS (B4), counted across runs: the subjects of the held names a cut run keeps (not offered, not refused) count from the start, and an offered name counts with the subjects it is put with (N3); a name over the limit is cut, and the run is a cut (Cut::Names). Without a cut, every listing of the host not among the verified names drops out; with a cut, the refused ones drop, and so does a held name the run neither offered nor refused once it has been unreached for seven days, whatever the cut (its own clock, N1). A verified name’s clock is cleared. The host’s row: last_seen the day of now, unreachable_since none, written only when that changes it.
  • Fetch::KeyDocFailed, Fetch::MeshDocFailed: every listing of the host drops out at once; the host’s row is left as it was.
  • Fetch::Unreachable: the listings stay; the host’s unreachable_since is written once, at the first failed run; when now is UNREACHABLE_DROP_AFTER or more after it, every listing of the host drops out.

A run that finds nothing changed writes nothing.