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
state
withstate.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 indirmgr
, advancing the state to the extent possible. - load_
and_ 🔒apply_ documents - Load every document in
missing
and 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
state
by 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
ClientRequest
s in order to fetch the documents indocs
. - no_
more_ 🔒than_ a_ week_ from - Helper: Clamp
v
so 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
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
withstate.reset()
.