Module bootstrap

Source
Expand description

Functions to download or load directory objects, using the state machines in the states module.

Macros§

propagate_fatal_errors 🔒
Given a Result<()>, exit the current function if it is anything other than Ok(), or a nonfatal error.

Structs§

AttemptId 🔒
Identifier for an attempt to bootstrap a directory.

Functions§

advance 🔒
Replace state with state.advance().
download 🔒
Download information into a DirState state machine until it is “complete”, or until we hit a non-recoverable error.
download_attempt 🔒
Helper: Make a set of download attempts for the current directory state, and on success feed their results into the state object.
fetch_multiple 🔒
Launch a set of download requests for a set of missing objects in missing, and return each request along with the response it received.
fetch_single 🔒
Launch a single client request and get an associated response.
load 🔒
Try to load as much state as possible for a provided state from the cache in dirmgr, advancing the state to the extent possible.
load_and_apply_documents 🔒
Load every document in missing and try to apply it to state.
load_documents_from_store 🔒
Load a set of documents from a Store, returning all documents found in the store. Note that this may be less than the number of documents in missing.
load_once 🔒
Try to update state by loading cached information from dirmgr.
make_consensus_request 🔒
Construct an appropriate ClientRequest to download a consensus of the given flavor.
make_requests_for_documents 🔒
Construct a set of ClientRequests in order to fetch the documents in docs.
no_more_than_a_week_from 🔒
Helper: Clamp v so that it is no more than one week from now.
note_cache_error 🔒
Record that a problem has occurred because of a failure in an answer from source.
note_cache_success 🔒
Record that source has successfully given us some directory info.
note_request_outcome 🔒
If there were errors from a peer in outcome, record those errors by marking the circuit (if any) as needing retirement, and noting the peer (if any) as having failed.
reset 🔒
Replace state with state.reset().