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 ofnameswhose descriptor hashes to itsfn_hashis 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 mostMAX_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, therefusedones 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_seenthe day ofnow,unreachable_sincenone, 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’sunreachable_sinceis written once, at the first failed run; whennowisUNREACHABLE_DROP_AFTERor more after it, every listing of the host drops out.
A run that finds nothing changed writes nothing.