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Β§
- Attempt
Id π - Identifier for an attempt to bootstrap a directory.
FunctionsΒ§
- advance π
- Replace
statewithstate.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
statefrom the cache indirmgr, advancing the state to the extent possible. - load_
and_ πapply_ documents - Load every document in
missingand try to apply it tostate. - 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 inmissing. - load_
once π - Try to update
stateby loading cached information fromdirmgr. - 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 indocs. - no_
more_ πthan_ a_ week_ from - Helper: Clamp
vso that it is no more than one week fromnow. - note_
cache_ πerror - Record that a problem has occurred because of a failure in an answer from
source. - note_
cache_ πsuccess - Record that
sourcehas 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
statewithstate.reset().