This reverts commit f30b22802a.
It turns out (see torspec#57) that there is no need for us to keep
this timestamp -- at least, not for the use we had in mind in
circuit timeouts.
We need this for the circuit timeout estimator (#57). It needs to
know "how recently have we got some incoming traffic", so that it
can tell whether a circuit has truly timed out, or whether the
entire network is down.
I'm implementing this with coarsetime, since we need to update these
in response to every single incoming cell, and we need the timestamp
operation to be _fast_.
To make this work we have to wrap std::io::Error in an Arc. The
benefit of having these errors implement Clone is that we can
provide the same Error in response to multiple requests when they
are all waiting on the same operation.
The previous API required the caller to check that the meta-cell it
got was coming from the right hop; the new API requires the caller
to say which hop it expects to get a cell from. With this change,
it's not possible to omit the correct-hop check.
This is a somewhat obnoxious change in its scope and requirements,
but it makes it easier to understand what the real public and
private parts of our APIs are.
Rust 1.52 just came out, and there are new clippy lints to deal
with:
* It spots more cases when we could use Option::map
* It spots more cases when we could use Iterator::flatten
* When we build a struct instance, it wants us to list the fields
in the same order that the struct declares them.
These lints force us to declare our exported enums and
exhaustive-looking structs as non-exhaustive (so that we can add to
them in the future without breaking our API) or to explicitly
disable the warning for a given enum/struct (to say that we _intend_
for additions to be a breaking change).